Home Blog Page 60

ios – I am unable to validate the Apple subscription in NestJS


I’ve created an endpoint in my app that permits me to ship the person ID and Apple receipt to validate the subscription immediately in my app.

I am utilizing node-apple-receipt-verify
However I am getting the next error:

0|app-backend  | Apple validation response: [
0|app-backend  |   app-backend  
0|app-backend  | ]
0|app-backend  | Invalid receipt acquired: [
0|app-backend  |   app-backend  
0|app-backend  | ]
0|app-backend  | Error throughout Apple receipt verification: Error: Invalid receipt
0|app-backend  |     at SubscriptionService.verifyAppleSubscription (src/subscription/subscription.service.ts:69:15)
0|app-backend  |     at node_modules/@nestjs/core/router/router-execution-context.js:46:28
0|app-backend  |     at node_modules/@nestjs/core/router/router-proxy.js:9:17

Listed here are the completely different codes I take advantage of:

  @Submit('confirm')
  async verifySubscription(
    @Physique('userId') userId: quantity,
    @Physique('receipt') receipt: string,
    @Physique('platform') platform: string,
  ) {
    if (!userId || !receipt || !platform) {
      throw new BadRequestException('Lacking parameters');
    }

    if (platform !== 'ios') {
      throw new BadRequestException('Solely iOS receipts are supported');
    }

    return this.subscriptionService.verifyAppleSubscription(userId, receipt);
  }


async onModuleInit() {
    if (!course of.env.APPLE_WEBHOOK_SECRET) {
      throw new Error(
        'APPLE_WEBHOOK_SECRET just isn't outlined in atmosphere variables',
      );
    }

    verifyAppleReceipt.config({
      secret: course of.env.APPLE_WEBHOOK_SECRET,
      atmosphere: 'manufacturing',
    });

    console.log('Apple receipt verification configured efficiently');
  }

  async verifyAppleSubscription(
    userId: quantity,
    receipt: string,
  ): Promise<{ success: boolean; message: string }> {
    userId = Quantity(userId);

    const person = await this.userService.findOne(userId);

    const userEmail = person.userEmail;
    console.log('[User Email]', userEmail);

    console.log('[START] verifyAppleSubscription known as with:', {
      userId,
      receipt,
    });

    console.log('Kind de userId:', typeof userId, 'Valeur:', userId);
    if (isNaN(userId)) {
      console.log('userId est NaN ! ');
    }

    if (!userId || !receipt) {
      console.log('Lacking parameters:', { userId, receipt });
      throw new BadRequestException('Lacking userId or receipt');
    }

    strive {
      console.log('Sending receipt for validation...');

      const trimmedReceipt = receipt.trim();
      const validationResponse = await verifyAppleReceipt.validate({
        receipt: trimmedReceipt,
      });

      console.log('Apple validation response:', validationResponse);

      if (!validationResponse || !validationResponse.receipt) {
        console.log('Invalid receipt acquired:', validationResponse);
        throw new Error('Invalid receipt');
      }

      const latestReceiptInfo = validationResponse.latest_receipt_info;
      console.log('Newest receipt data:', latestReceiptInfo);

      const isActive = latestReceiptInfo?.some((sub) => {
        const productId = sub.product_id?.trim();
        console.log('Produit analysé:', productId);

        console.log('Checking subscription expiration:', {
          expires_date_ms: sub.expires_date_ms,
          expires_date: new Date(Quantity(sub.expires_date_ms)),
          now: new Date(),
        });

        return new Date(Quantity(sub.expires_date_ms)) > new Date();
      });

      console.log('Is subscription energetic?', isActive);

      if (isActive) {
        console.log('Subscription is energetic. Updating person in DB...');

        await this.userRepository.replace(userId, { isSubscribed: true });

        console.log('Consumer subscription up to date efficiently.');
        return { success: true, message: 'Subscription verified and up to date' };
      } else {
        console.log('Subscription is expired or invalid.');
        return { success: false, message: 'Subscription expired or invalid' };
      }
    } catch (error) {
      console.log('Error throughout Apple receipt verification:', error);

      throw new BadRequestException(
        `Apple receipt verification failed: ${error.message}`,
      );
    }
  }
}

Have you learnt find out how to repair this downside?
Thanks a lot prematurely.

When You Lose Weight, The place Does It Really Go? – NanoApps Medical – Official web site


Most well being professionals lack a transparent understanding of how physique fats is misplaced, typically subscribing to misconceptions like fats changing to power or muscle.

The reality is, fats is definitely damaged down into carbon dioxide and water, with nearly all of the misplaced fats being exhaled as carbon dioxide. This perception is essential for understanding the true mechanics behind weight reduction and dispelling widespread myths.

Unveiling Weight Loss Misconceptions

The world is obsessive about weight reduction and fad diets, but few individuals truly perceive the place fats goes once we drop a few pounds.

Even amongst 150 medical doctors, dietitians, and private trainers we surveyed, this data hole was surprisingly widespread. Essentially the most widespread fable was that fats is transformed into power. Nevertheless, this concept contradicts the legislation of conservation of matter, which all chemical reactions obey.

Some respondents believed fats transforms into muscle, which is inconceivable, whereas others assumed it exits by way of the digestive system. In actuality, solely three individuals in our survey received the right reply. Meaning 98% of those well being professionals couldn’t precisely clarify how weight reduction works.

So if fats isn’t became power, muscle, or waste, the place does it truly go?

The Shocking Science of Fats Loss

The proper reply is that fats is transformed to carbon dioxide and water. You exhale the carbon dioxide and the water mixes into your circulation till it’s misplaced as urine or sweat.

If you happen to lose 10 kilos of fats, exactly 8.4lb comes out by way of your lungs, and the remaining 1.6lb turns into water. In different phrases, practically all the load we lose is exhaled.

This surprises nearly everybody, however truly, nearly the whole lot we eat comes again out by way of the lungs. Each carbohydrate you digest and practically all of the fat are transformed to carbon dioxide and water. The identical goes for alcohol.

Protein shares the identical destiny, apart from the small half that turns into urea and different solids, which you excrete as urine.

The one factor in meals that makes it to your colon undigested and intact is dietary fiber (assume corn). The whole lot else you swallow is absorbed into your bloodstream and organs and, after that, it’s not going anyplace till you’ve vaporized it.

Understanding Vitality and Weight Dynamics

All of us study that “power in equals power out” in highschool. However power is a notoriously complicated idea, even amongst well being professionals and scientists who research weight problems.

The rationale we achieve or drop a few pounds is way much less mysterious if we hold observe of all of the kilograms, too, not simply these enigmatic kilojoules or energy.

In response to the most recent authorities figures, Australians devour 3.5kg of meals and drinks each day. Of that, 415 grams is strong macronutrients, 23 grams is fiber and the remaining 3kg is water.

What’s not reported is that we inhale greater than 600 grams value of oxygen, too, and this determine is equally necessary on your waistline.

If you happen to put 3.5kg of meals and water into your physique, plus 600 grams of oxygen, then 4.1kg of stuff wants to come back again out, otherwise you’ll achieve weight. If you happen to’re hoping to shed some weight, greater than 4.1kg must go. So how do you make this occur?

The 415 grams of carbohydrates, fat, protein, and alcohol most Australians eat each day will produce precisely 740 grams of carbon dioxide plus 280 grams of water (about one cup) and about 35 grams of urea and different solids excreted as urine.

A median 75kg particular person’s resting metabolic fee (the speed at which the physique makes use of power when the particular person isn’t transferring) produces about 590 grams of carbon dioxide per day. No capsule or potion you should purchase will enhance that determine, regardless of the daring claims you may need heard.

The excellent news is that you just exhale 200 grams of carbon dioxide whilst you’re quick asleep each night time, so that you’ve already breathed out 1 / 4 of your each day goal earlier than you even step away from bed.

Metabolic Fate of Dietary Intake
The metabolic destiny of a median Australian’s each day consumption of meals, water and oxygen. Nutrient consumption knowledge: Australian Bureau of Statistics, Australian Well being Survey: Vitamin First Outcomes – Meals and Vitamins

Lively Options to Weight Loss

So if fats turns into carbon dioxide, might merely respiratory extra make you drop a few pounds? Sadly not. Huffing and puffing greater than you’ll want to is named hyperventilation and can solely make you dizzy, or presumably faint. The one manner you’ll be able to consciously enhance the quantity of carbon dioxide your physique is producing is by transferring your muscle mass.

However right here’s some extra excellent news. Merely standing up and getting dressed greater than doubles your metabolic fee. In different phrases, when you merely tried on all of your outfits for twenty-four hours, you’d exhale greater than 1,200 grams of carbon dioxide.

Extra realistically, going for a stroll triples your metabolic fee, and so will cooking, vacuuming, and sweeping.

Metabolizing 100 grams of fats consumes 290 grams of oxygen and produces 280 grams of carbon dioxide plus 110 grams of water. The meals you eat can’t change these figures.

Due to this fact, to lose 100 grams of fats, it’s a must to exhale 280 grams of carbon dioxide on prime of what you’ll produce by vaporizing all of your meals, it doesn’t matter what it’s.

Any weight loss plan that provides much less “gasoline” than you burn will do the trick, however with so many misconceptions about how weight reduction works, few of us know why.

Written by:

  • Ruben Meerman, Assistant scientist, UNSW Sydney
  • Andrew Brown, Professor and Head, Faculty of Biotechnology and Biomolecular Sciences, UNSW Sydney

Tailored from an article initially revealed in The Dialog.

Kabisa EV Home Opens in Kigali as New Hub for e-Mobility in Rwanda



Join CleanTechnica’s Weekly Substack for Zach and Scott’s in-depth analyses and excessive stage summaries, join our day by day publication, and/or observe us on Google Information!


Rwanda is among the nations with among the most progressive electrical car insurance policies. A  couple of years in the past, Rwanda launched some actually cool incentives for EVs that included:

Fiscal Incentives:

  • Electrical energy tariffs for charging stations to be capped on the industrial tariff. Because of this cost level operators will probably be billed at near USD 10 cents/kWh as an alternative of shut to twenty cents/kWh.
  • Electrical automobiles may even profit from lowered tariffs throughout off-peak durations.
  • Electrical automobiles, spare elements, batteries, and charging station gear will all be exempted from import and excise duties. All of those would even be handled as zero rated VAT merchandise and also will be exempt from withholding tax.

Non-Fiscal Incentives:

  • Lease-free land for charging stations on land owned by the federal government.
  • Provisions for EV charging stations within the constructing code and metropolis planning guidelines.
  • Inexperienced license plates to permit preferential parking for EVs and free entry into any future congestion zones.
  • Entry to devoted bus lanes.
  • Present desire to electrical automobiles for government-hired automobiles.
  • Regulate the importation of used automobiles by imposing an age restrict.
  • Set up restricted zones the place solely inexperienced automobiles can have entry.
  • Enforcement of present emission requirements to discourage the acquisition of polluting automobiles.

Rwanda is actively encouraging funding within the e-mobility sector, and the Rwanda Growth Board (RDB) additionally gave a presentation outlining among the initiatives to encourage funding. A few of these incentives embody a preferential company earnings tax price of 15% for traders working in e-mobility. Corporations working within the power, ITC, and mass transport industries additionally qualify. And from January 1, 2025, solely electrical bikes may be registered in Rwanda.

Hybrids additionally benefited from incentives, however a few of these incentives are actually being rolled again. Hybrids will proceed to get import obligation exemptions, however will now pay VAT. In a market dominated by used car imports, the Rwanda authorities desires to encourage newer hybrids that also have good battery well being and discourage older hybrids. Subsequently, there’s now a brand new excise obligation for hybrids that varies with the age of the car. For automobiles which can be 3 years and beneath from the age of manufacture, the excise obligation is 5%. This excise obligation will probably be 10% for automobiles between 4 and seven years, and 15% for automobiles older than that.

We’re already beginning to see the advantages of those sorts of incentives. Though Rwanda is a a lot smaller market than a few of its regional friends, these incentives have led to Rwanda having extra electrical vehicles than a lot of the bigger markets in East Africa. There are about 360,000 automobiles registered in Rwanda, with about 30,000 added every year. 99% of those automobiles are nonetheless ICE automobiles. Because the introduction of incentives for EVs, there was some vital traction, although, with Rwanda now having an estimated electrical automobile fleet of round 700 automobiles. This quantity turns into extra spectacular for this small market while you take a look at bigger markets within the area equivalent to Kenya. Kenya has a fleet of round 4 million automobiles (throughout all car classes), and about 100,000 vehicles are added every year. Kenya doesn’t have all these good EV incentives but, and it reveals, as there are nonetheless nearly 200 electrical vehicles in Kenya. This implies Rwanda now has 3.5 instances the variety of electrical vehicles in Kenya, regardless of being a a lot smaller market.

Kabisa EV Home Opens in Kigali as New Hub for e-Mobility in Rwanda
Kabisa says its new Kabisa EV Home is greater than a automobile showroom, the centre will present charging stations, tech-enabled upkeep services, assembly house for neighborhood occasions and coaching, and employees headquarters for the fast-growing EV participant Kabisa. Picture courtesy of Kabisa.

One of many corporations main this development in Rwanda is Kabisa. Kabisa, is one in every of East Africa’s main suppliers of electrical car (EV) gross sales, upkeep, and charging. Kabisa not too long ago held a grand opening reception final month at EV Home, their new headquarters in Kigali positioned above Camp Kigali on KN 77 Avenue.

Picture courtesy of Kabisa

Kabisa intends for EV Home to function a one-stop-shop for EV homeowners in Rwanda, offering charging and upkeep providers for EVs no matter the place they’re bought. The brand new telemechanic-enabled diagnostics bay and upkeep services are custom-built for the wants of EV homeowners and drivers. The house may even host occasions, meetups, and coaching classes for all events, from executives to drivers to technologists.

Given the rising e-mobility panorama in Rwanda, partnerships are core to Kabisa EV Home. Clear power infrastructure firm Meshpower took the lead in putting in new photo voltaic panels at EV Home, which means clients can cost off-grid on the facility utilizing renewable solar energy. On the grand opening, SLS Vitality (specializing in battery operations and recycling) supplied demonstrations of its battery applied sciences in a nod to the total vary of companions sharing the mission to maneuver Rwanda to a clear, sustainable transportation future.

On the floor ground showroom, Kabisa’s hottest automobiles have been on show and obtainable for take a look at drives, together with Farizon business vans and vans, the BYD Track Plus SUV, the Radar pickup, and the Chery iCar SUV.

On the Grand Opening, Pophia Muhoza, Kabisa Rwanda Managing Director, thanked the 130+ attendees and acknowledged the progress and potential of e-mobility in Rwanda: “It’s a blessing to see so many shoppers, supporters, companions, and pals gathered in our new house, an thrilling bodily illustration of the progress we’re making — however we’re really solely getting began.”

To assist this rising fleet of electrical automobiles in Rwanda, Kabisa additionally not too long ago launched a brand new ultra-fast charging facility at SP’s Kanombe station, in Kigali. The ultra-fast charging facility has chargers with an influence capability of as much as 240 kW, in comparison with a lot of the present charging stations in Kigali averaging 7.43 kW to 22kW. The six charging bays permit each non-public electrical vehicles and whole business fleets of electrical vans, vans, or buses to cost concurrently. Electrical automobiles will cost as much as 10 instances sooner with the ultra-fast charger in comparison with regular AC or DC chargers — so most automobiles can cost in 15–25 minutes as an alternative of multiple hour at standard charging stations. It will go a great distance in engaging operators of business fleets to transition to electrical, as they want their automobiles to be on the street extra usually than drivers of private automobiles do, who can have the posh of charging at residence or on the workplace the place the automobiles spend most of their time parked.

Whether or not you’ve gotten solar energy or not, please full our newest solar energy survey.




Have a tip for CleanTechnica? Need to promote? Need to counsel a visitor for our CleanTech Speak podcast? Contact us right here.


Join our day by day publication for 15 new cleantech tales a day. Or join our weekly one if day by day is simply too frequent.


Commercial



 


CleanTechnica makes use of affiliate hyperlinks. See our coverage right here.

CleanTechnica’s Remark Coverage




ForwardX new self-production facility to supply 5,000 cell robots per yr

0


ForwardX new self-production facility to supply 5,000 cell robots per yr

ForwardX’s new facility will dedicate areas to constructing several types of robots, which it mentioned will guarantee high quality management. | Supply: ForwardX

ForwardX Expertise Co. this week unveiled its new robotics manufacturing facility, which is able to handle its total manufacturing course of, from meeting to testing. The Beijing, China-based firm mentioned this underscores its dedication to self-sufficient manufacturing.

The ten,000-sq.-m (107,639-sq.-ft.) facility spans two buildings and options a number of manufacturing traces that cowl the complete manufacturing course of. ForwardX Robotics mentioned it constructed the ability in 2022.

The manufacturing facility features a 4,500-sq.-m (48,437.6-sq.-ft.) part that focuses on wire harness processing, together with the meeting and testing of smaller autonomous cell robotic (AMR) fashions. The remainder of the world focuses on the manufacturing of bigger AMRs and autonomous forklifts, along with software program integration and system testing.

“This setup ensures complete capabilities and full high quality management all through every section of manufacturing,” the firm mentioned. “By integrating these various features underneath one roof, the ability permits ForwardX to fulfill the rising demand for automation options whereas sustaining full management over manufacturing processes.”

FowardX expects to fulfill market demand

With an annual manufacturing capability of 5,000 models, ForwardX Robotics mentioned its manufacturing facility is well-positioned to fulfill the growing world demand for superior robots.

Along with an elevated manufacturing capability, the corporate asserted that the ability will empower it to innovate and ship high-quality, dependable merchandise. Its self-sufficient manufacturing may also guarantee distinctive efficiency and robust after-sales help, mentioned ForwardX.

The ability may also play a key function in supporting ongoing analysis and improvement for its subsequent robotics methods, the corporate famous. ForwardX mentioned it has greater than 250 workers from main universities and enterprises world wide, in addition to over 350 patents.

Facility to assist ForwardX broaden portfolio

ForwardX provides a spread of vision-based AMRs, and its lineup is rising. Final yr, it launched smaller, nimbler, middleweight AMRs. The Flex 300-L Mini is a platform AMR that additionally serves because the cell base for the Flex 300-SCB Mini.

Each AMRs supply a 300 kg (661.3 lb.) most payload and are designed to traverse slender, one-way aisles with widths between 800 to 1,000 mm (31.4 to 39.3 in.). The 300-SCB Mini contains a structural shelving unit, human-machine interface (HMI), and barcode scanner.

The SCB model has a peak of 1,400 mm (55.1 in.) for the shelving unit, compared with the Flex 300-L base peak of 295 mm (11.6 in.). The remainder of the specs are the identical for each models.

ForwardX additionally supplies fleet-management software program to assist automate supplies dealing with in manufacturing and warehousing amenities. The corporate mentioned it has deployed greater than 3,000 AMRs in over 150 amenities throughout 4 continents.

ForwardX gained a 2022 RBR50 Robotics Innovation Award for its 5G AMR deployment in TCL’s Huizhou manufacturing facility, which offered elevated flexibility. The corporate, which claimed it’s the largest goods-to-person (G2P) cell robotic supplier in Asia, has set its sights on world enlargement. Final yr, it partnered with VOYATZOGLOU Group as its official distributor in Greece.


SITE AD for the 2025 Robotics Summit registration.
Register now so you do not miss out!


react native – Google-Maps-iOS-Utils/GoogleMapsUtils.modulemap’ not discovered


My Podfile :-

# Resolve react_native_pods.rb with node to permit for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, min_ios_version_supported
prepare_react_native_project!

# Add Google Maps pod
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'
pod 'react-native-google-maps', :path => '../node_modules/react-native-maps', :modular_headers => true
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

# Add permissions configuration for react-native-permissions
require_relative '../node_modules/react-native-permissions/scripts/setup'
setup_permissions([
  'LocationAccuracy',
  'LocationAlways',
  'LocationWhenInUse',
])


linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.places "Configuring Pod with #{linkage}ally linked Frameworks".inexperienced
  use_frameworks! :linkage => linkage.to_sym
finish

goal 'EquiptApp' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # An absolute path to your software root.
    :app_path => "#{Pod::Config.occasion.installation_root}/.."
  )

  goal 'EquiptAppTests' do
    inherit! :full
    # Pods for testing
  finish

  post_install do |installer|
    # https://github.com/fb/react-native/blob/principal/packages/react-native/scripts/react_native_pods.rb#L197-L202
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
      # :ccache_enabled => true
    )
  finish
finish

I’m able to efficiently run the app utilizing metro, however when i attempting to archive or construct launch my app utilizing xcode(proj or workspace) I get the talked about error

Utilizing M4 chip mac, and xcode verison – 16.2

variations of deps utilizing :-
“react-native”: “0.76.1”,
“react-native-maps”: “^1.20.1”