Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all 17263 articles
Browse latest View live

'FirebaseCore/FirebaseCore.h' file not found in RNFIRMessaging.h

$
0
0

I want to archive ios part of a project written in react-native but in file 'RNFIRMessaging.h' I get an error 'FirebaseCore/FirebaseCore.h' file not found.

I use GoogleMLKit/TextRecognition framework which requires that I use use_frameworks! in my Podfile. And together with Firebase/Messaging it forms a conflict.

I tried deleting Podfile.lock and reinstalling, using modular_headers => true and cleaning DerivedData directory but nothing seems to work.

My Podfile:

platform :ios, '10.0'rn_path = '../node_modules/react-native'target 'app' do  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks  # use_frameworks!  # Pods for handiCash  pod 'Google-Mobile-Ads-SDK', '7.55.0'  use_frameworks!  pod 'GoogleMLKit/TextRecognition'  pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"  pod 'React', path: rn_path, subspecs: ['Core','RCTImage',  ]  pod 'Firebase', '6.9.0'  pod 'Firebase/Messaging'  pod 'Firebase/Analytics'  target 'appTests' do    inherit! :search_paths    # Pods for testing  endend

I use Xcode 12.5.1


Apple in app provisioning 'Could not add card'

$
0
0

I am implementing apple in-app provisioning and I follow all steps in the apple guide but in the end, I get a message 'Could not add card' but don't have any error throw this process.This is how I create PKAddPaymentPassViewController

      let cardInfoPass  = PKAddPaymentPassRequestConfiguration.init(encryptionScheme: PKEncryptionScheme.ECC_V2);  cardInfoPass?.cardholderName = cardholderName as? String; //The name of the person as shown on the card.  cardInfoPass?.primaryAccountSuffix = primaryAccountSuffix as? String; //The last four or five digits of the card’s number.  cardInfoPass?.localizedDescription = localizedDescription as? String; //A short description of the card.  cardInfoPass?.paymentNetwork = PKPaymentNetwork.masterCard;  cardInfoPass?.primaryAccountIdentifier = primaryAccountIdentifier as? String; // A primary account identifier, used to filter out pass libraries.

cardholderName is the name written on the cardprimaryAccountSuffix last 4 digit written on the cardlocalizedDescription bank namepaymentNetwork we are using master cardprimaryAccountIdentifier it is number from iTunes something light this 1MNJDDA667.com.bank.package.name

I think this part is correct I can open the apple wallet modal and all this data are there but when I continue in a modal on the end I need to get certificate and send this certificate to our BE and be should send me back 3 values and they send it to me

...  let certificateLeaf = certificates[0].base64EncodedString();  let certificateSubCA = certificates[1].base64EncodedString();  let nonceString = nonce.base64EncodedString();  let nonceSignature = nonceSignature.base64EncodedString();  ...  let reqDataDic: [String: Any]  = ["cardId": cardId,"applePublicCertificate": certificateSubCA,"nonce": nonceString,"nonceSignature": nonceSignature,"customerId": customerId,"deviceId": deviceId,  ]  ....  var request = URLRequest(url: url)  request.httpMethod = "POST"  ....  request.httpBody = try? JSONSerialization.data(withJSONObject: reqDataDic, options: .prettyPrinted)

BE send me back all values that I need: activationData, ephemeralPublicKey, encryptedPassData it returns it as a JSON object so I need to convert it to Data and all these values put into handler

this is how I am putting data to handler:

          if let dictionaryJson = try JSONSerialization.jsonObject(with: data!, options: []) as? [String: Any] {        let activationDataString = dictionaryJson["activationData"] as! String;        let ephemeralPublicKeyString = dictionaryJson["ephemeralPublicKey"] as! String;        let encryptedPassDataString = dictionaryJson["encryptedPassData"] as! String;        let activationData = activationDataString.data(using: .utf8)        let ephemeralPublicKey  = Data(base64Encoded: ephemeralPublicKeyString)        let encryptedPassData = Data(base64Encoded: encryptedPassDataString)        let paymentPassRequest = PKAddPaymentPassRequest.init()        paymentPassRequest.activationData = activationData;        paymentPassRequest.encryptedPassData = encryptedPassData;        paymentPassRequest.ephemeralPublicKey = ephemeralPublicKey;        handler(paymentPassRequest)     }

I fill all data into paymentPassRequest and all looks ok xCode is not complaining.And at this moment apple wallet shows an alert dialog with Could not add a card with 2 buttons try it later or try it again ....

  • I have a card whitelisted on the MasterCard side
  • I tried it on simulators, real devices, and also on app in TestFlight

how to solve ("main" has not been registered .this can happen if : ) Error in React native with expo

$
0
0

I've been developing a react native app with Expo on an android emulator and also through expo go on my iPhone (i don't own a mac) and decided to let my iPhone and only focus on my android emulator since it's not practical to keep touching your phone so after a while and until i nearly finished (not finished yet) my app and I want to run it on my iPhone using expo go I did git the error saying

"main" has not been registered .this can happen if:...

just to know the android emulator and also the expo go a android device is working just fine the problem is only on my iPhoneI've been trying a lot of fixes like upgrading my expo-cli and editing my index.js to

import "react-native-gesture-handler";import { registerRootComponent } from "expo";import App from "./App";// registerRootComponent calls AppRegistry.registerComponent('main', () => App);// It also ensures that whether you load the app in Expo Go or in a native build,// the environment is set up appropriatelyregisterRootComponent(App);

can anybody help me with this error and how to get solved on my iPhone and i need the app for iPhone not only for android

this is mypackage.jsonin case it will help

{"main": "index.js","scripts": {"android": "react-native run-android","ios": "react-native run-ios","web": "expo start --web","start": "react-native start"  },"dependencies": {"@react-navigation/bottom-tabs": "^5.11.11","@react-navigation/drawer": "^5.12.5","@react-navigation/native": "^5.9.4","@react-navigation/stack": "^5.14.5","@reduxjs/toolkit": "^1.6.0","expo": "~41.0.1","expo-splash-screen": "~0.10.2","expo-status-bar": "~1.0.4","expo-updates": "~0.5.4","firebase": "8.2.3","react": "16.13.1","react-dom": "16.13.1","react-native": "~0.63.4","react-native-elements": "^3.4.2","react-native-gesture-handler": "~1.10.2","react-native-nfc-manager": "^3.7.0","react-native-reanimated": "~2.1.0","react-native-safe-area-context": "3.2.0","react-native-screens": "~3.0.0","react-native-super-grid": "^4.1.3","react-native-unimodules": "~0.13.3","react-native-web": "~0.13.12","react-redux": "^7.2.4","redux": "^4.1.0"  },"devDependencies": {"@babel/core": "^7.9.0"  },"private": true}

my app.json

{"name": "TAGI","displayName": "TAGI","expo": {"name": "TAGI","slug": "TAGI","version": "1.0.0","assetBundlePatterns": ["**/*"    ],"plugins": ["react-native-nfc-manager"    ]  }}

App Clip with EXPO React Native not found the app entry point module name?

$
0
0

I'm trying to integrate the App Clip feature in my application developed in react native with EXPO.

I state that I have already integrated the App Clip feature in a React Native project without EXPO and I have not had any major problems while with expo I have a problem that I cannot solve.

I get this error in main.m file:

Invariant Violation: "ReactNativeTest" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called.

I believe the problem is related to the ViewController.m file in this point:

// moduleName corresponds to the appName used for the// app entry point in "index.js"RCTRootView *rootView = [[RCTRootView alloc]initWithBundleURL:jsCodeLocation moduleName:@"ReactNativeTest"initialProperties:nil launchOptions:nil];

In a project without EXPO the moduleName for the app entry point in "index.js" is this

enter image description here

but in this case it doesn't work, do you have a solution?

Generate live streaming sound (DAC - Digital analog converter)

$
0
0

What I want to achieve :

A modular synthesizer with react native (personal project)

My Problem :

I only found library where you can play sound from .mp3 or basic math.

My goal is to use filters to produce the sound and play it in live streaming.Recording is an option.

Push notifications not sending with test despite having APN & specific device FCM token

$
0
0

I've looked all over stackoverflow and google for an answer to this, these are some of the things I've tried:

I'll run through what I've got:

AppDelegate.m:

#import "AppDelegate.h"#import <React/RCTBridge.h>#import <React/RCTBundleURLProvider.h>#import <React/RCTRootView.h>@import Firebase;@import UserNotifications;/** Flipper **/#ifdef FB_SONARKIT_ENABLED  #import <FlipperKit/FlipperClient.h>  #import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>  #import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>  #import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>  #import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>  #import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>  static void InitializeFlipper(UIApplication *application) {    FlipperClient *client = [FlipperClient sharedClient];    SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];    [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];    [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];    [client addPlugin:[FlipperKitReactPlugin new]];    [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];    [client start];  }#endif/** End Flipper **/// Implement UNUserNotificationCenterDelegate to receive display notification via APNS for devices// running iOS 10 and above.@interface AppDelegate () <UNUserNotificationCenterDelegate>@end@implementation AppDelegateNSString *const kGCMMessageIDKey = @"gcm.message_id";- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  #ifdef FB_SONARKIT_ENABLED    InitializeFlipper(application);  #endif  [FIRApp configure];  [FIRMessaging messaging].delegate = self;  /* Messaging */  if ([UNUserNotificationCenter class] != nil) {    // iOS 10 or later    // For iOS 10 display notification (sent via APNS)    [UNUserNotificationCenter currentNotificationCenter].delegate = self;    UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert |        UNAuthorizationOptionSound | UNAuthorizationOptionBadge;    [[UNUserNotificationCenter currentNotificationCenter]        requestAuthorizationWithOptions:authOptions        completionHandler:^(BOOL granted, NSError * _Nullable error) {          // ...        }];  } else {    // iOS 10 notifications aren't available; fall back to iOS 8-9 notifications.    UIUserNotificationType allNotificationTypes =    (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);    UIUserNotificationSettings *settings =    [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];    [application registerUserNotificationSettings:settings];  }  [application registerForRemoteNotifications];  /*  [[FIRMessaging messaging] tokenWithCompletion:^(NSString *token, NSError *error) {    if (error != nil) {      NSLog(@"Error getting FCM registration token: %@", error);    } else {      NSLog(@"FCM registration token: %@", token);      //[FIRMessaging messaging].fcmRegTokenMessage.text = token;    }  }];  /* End Messaging */  /* Bridge */  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge                                                   moduleName:@"UBFounders"                                            initialProperties:nil];  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];  UIViewController *rootViewController = [UIViewController new];  rootViewController.view = rootView;  self.window.rootViewController = rootViewController;  [self.window makeKeyAndVisible];  /* End Bridge */  return YES;}/* Monitor token refresh */- (void)messaging:(FIRMessaging *)messaging didReceiveRegistrationToken:(NSString *)fcmToken {    NSLog(@"FCM registration token: %@", fcmToken);    // Notify about received token.    NSDictionary *dataDict = [NSDictionary dictionaryWithObject:fcmToken forKey:@"token"];    [[NSNotificationCenter defaultCenter] postNotificationName:     @"FCMToken" object:nil userInfo:dataDict];    // TODO: If necessary send token to application server.    // Note: This callback is fired at each app startup and whenever a new token is generated.}/* End token refresh */// [START receive_message]- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo    fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {  // If you are receiving a notification message while your app is in the background,  // this callback will not be fired till the user taps on the notification launching the application.  // TODO: Handle data of notification  // With swizzling disabled you must let Messaging know about the message, for Analytics  // [[FIRMessaging messaging] appDidReceiveMessage:userInfo];  // [START_EXCLUDE]  // Print message ID.  if (userInfo[kGCMMessageIDKey]) {    NSLog(@"Message ID: %@", userInfo[kGCMMessageIDKey]);  }  // [END_EXCLUDE]  // Print full message.  NSLog(@"%@", userInfo);  completionHandler(UIBackgroundFetchResultNewData);}// [END receive_message]// [START ios_10_message_handling]// Receive displayed notifications for iOS 10 devices.// Handle incoming notification messages while app is in the foreground.- (void)userNotificationCenter:(UNUserNotificationCenter *)center       willPresentNotification:(UNNotification *)notification         withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {  NSDictionary *userInfo = notification.request.content.userInfo;  // With swizzling disabled you must let Messaging know about the message, for Analytics  // [[FIRMessaging messaging] appDidReceiveMessage:userInfo];  // [START_EXCLUDE]  // Print message ID.  if (userInfo[kGCMMessageIDKey]) {    NSLog(@"Message ID: %@", userInfo[kGCMMessageIDKey]);  }  // [END_EXCLUDE]  // Print full message.  NSLog(@"%@", userInfo);  // Change this to your preferred presentation option  completionHandler(UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionAlert);}// Handle notification messages after display notification is tapped by the user.- (void)userNotificationCenter:(UNUserNotificationCenter *)centerdidReceiveNotificationResponse:(UNNotificationResponse *)response         withCompletionHandler:(void(^)(void))completionHandler {  NSDictionary *userInfo = response.notification.request.content.userInfo;  if (userInfo[kGCMMessageIDKey]) {    NSLog(@"Message ID: %@", userInfo[kGCMMessageIDKey]);  }  // With swizzling disabled you must let Messaging know about the message, for Analytics  // [[FIRMessaging messaging] appDidReceiveMessage:userInfo];  // Print full message.  NSLog(@"%@", userInfo);  completionHandler();}// [END ios_10_message_handling]- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge{  #if DEBUG    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];  #else    return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];  #endif}@end

So basically I run the app, fetch the FCM Registration Token from the Console, as so:enter image description here

Then I add the token to the Notification Center and try a test send, as so:enter image description here

You can see from the reports, none of the notifications are being received, as so:enter image description here

Not sure what else to try. Thoughts?

Tracking how far a user has scrolled in a React Native flatlist

$
0
0

I'm working on an IOS app in React Native right now, and we present our content feed to the user as a flatlist that they can scroll through. I need to keep track of how far they have scrolled into that flatlist so that I know which posts they have actually viewed in case they close the app. I'm looking at using React Asynchronous storage for this, but I was wondering how I can actually implement that into my flatlist.

"Undefined symbol: protocol descriptor for Swift.ExpressibleByFloatLiteral" issue while installing react native on macOS Big Sur

$
0
0

I was trying to install React Native on my system, and found that it failed to install CocoaPods dependencies which is required by that template error.

sudo arch -x86_64 gem install ffi fixed this issue but ended up with event-config.h" file not found error.

I changed the changed the flipper version in pod file to use_flipper!({'Flipper'=>'0.76.0'}) and then I reached to the error mentioned above. Any help on this issue would be appreciated.

node version : 15.10.0react-native version: 0.63.4Xcode version: 12.4

Error description below:

Showing Recent MessagesCould not find or use auto-linked library 'swiftCoreGraphics'Could not find or use auto-linked library 'swiftUIKit'Could not find or use auto-linked library 'swiftDarwin'Could not find or use auto-linked library 'swiftFoundation'Could not find or use auto-linked library 'swiftMetal'Could not find or use auto-linked library 'swiftObjectiveC'Could not find or use auto-linked library 'swiftCoreFoundation'Could not find or use auto-linked library 'swiftDispatch'Could not find or use auto-linked library 'swiftCoreImage'Could not find or use auto-linked library 'swiftQuartzCore'Could not find or use auto-linked library 'swiftCore'Could not find or use auto-linked library 'swiftSwiftOnoneSupport'Undefined symbol: protocol descriptor for Swift.ExpressibleByFloatLiteralUndefined symbol: associated type descriptor for Swift.ExpressibleByIntegerLiteral.IntegerLiteralTypeUndefined symbol: associated conformance descriptor for Swift.ExpressibleByIntegerLiteral.Swift.ExpressibleByIntegerLiteral.IntegerLiteralType: Swift._ExpressibleByBuiltinIntegerLiteralUndefined symbol: method descriptor for Swift.ExpressibleByFloatLiteral.init(floatLiteral: A.FloatLiteralType) -> AUndefined symbol: protocol descriptor for Swift.ExpressibleByIntegerLiteralUndefined symbol: value witness table for Builtin.Int32Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreImageUndefined symbol: associated type descriptor for Swift.ExpressibleByFloatLiteral.FloatLiteralTypeUndefined symbol: __swift_FORCE_LOAD_$_swiftQuartzCoreUndefined symbol: __swift_FORCE_LOAD_$_swiftDispatchUndefined symbol: method descriptor for Swift.ExpressibleByIntegerLiteral.init(integerLiteral: A.IntegerLiteralType) -> AUndefined symbol: __swift_FORCE_LOAD_$_swiftCoreFoundationUndefined symbol: protocol witness table for Swift.Int : Swift._ExpressibleByBuiltinIntegerLiteral in SwiftUndefined symbol: __swift_FORCE_LOAD_$_swiftObjectiveCUndefined symbol: __swift_FORCE_LOAD_$_swiftCoreGraphicsUndefined symbol: _swift_getForeignTypeMetadataUndefined symbol: __swift_FORCE_LOAD_$_swiftFoundationUndefined symbol: associated conformance descriptor for Swift.ExpressibleByFloatLiteral.Swift.ExpressibleByFloatLiteral.FloatLiteralType: Swift._ExpressibleByBuiltinFloatLiteralUndefined symbol: __swift_FORCE_LOAD_$_swiftUIKitUndefined symbol: __swift_FORCE_LOAD_$_swiftMetalUndefined symbol: Swift.Float.init(Swift.Double) -> Swift.FloatUndefined symbol: __swift_FORCE_LOAD_$_swiftDarwinUndefined symbol: protocol witness table for Swift.Float : Swift._ExpressibleByBuiltinFloatLiteral in Swift

Unable to use native iOS component in react-native WebView

$
0
0

I have a native swift component PhoneWebView I use this to display click to call phone links web views by inheriting it in my JS file. Although I am using if(Platform.OS === 'ios'){ in my previous file call to display different content for iOS and Android still I am getting the below error not sure what's missing. Could someone please correct me?

https://i.stack.imgur.com/pTQtS.png

ERROR    Invariant Violation: Tried to register two views with the same name ATMWebViewThis error is located at:    in FileRenderWebView (at SceneView.tsx:122)    in StaticContainer    in StaticContainer (at SceneView.tsx:115)    in EnsureSingleNavigator (at SceneVie
    import React, {   } from 'react';    import {requireNativeComponent, SafeAreaView, StatusBar} from 'react-native';    import {useFocusEffect} from '@react-navigation/native';    export default function FileRenderWebView({route, navigation}) {            const PhoneWebView = requireNativeComponent('ATMWebView');            useFocusEffect(          React.useCallback(() => {                        console.log("filerenderwebview----****");              }, [route.params]))        return (<><StatusBar barStyle="dark-content" /><SafeAreaView style={{flex: 1}}><PhoneWebView                         uri="https://www.apple.com/contact/"                         style={{flex: 1}}                         onLoaded={pageLoaded}                       /></SafeAreaView>                   </>        )    }

making a multiline, expanding TextInput with React-Native

$
0
0

I'm working on a react-native app and need a TextInput that has similar functionality to the textview in the "messages" app on iOS—it should start out as one line and then gracefully expand to more lines until some limit (like 5 lines of text) and then start scrolling along to latest line as needed.

Took a look at the SlackTextViewController but a) seems like it has a lot of stuff that I don't want and b) I'd like to try to keep as much code in React (and out of objective-C/swift) as possible.

Edit: Just want to emphasize that I would prefer REACT (JAVASCRIPT) code, as stated above, rather than Objective-C or Swift.

React Native: AWS amplify requires that I tap `federatedSignIn` twice for google to succeed

$
0
0

My app is requiring that google oauth (via federatedSignIn) be tapped twice in iOS devices, prior to actually signing the user in.

Process:

  1. Upon the first tap, inapp browser opens up and you select which account you're intending to sign in with. Inapp browser closes and seems like all the rest of my logic is not being hit.
  2. Upon the second tap, the inapp browser re-opens up again for a split second (screen is blank), and then closes and THEN the user is actually signed in.

On the iOS simulator/android, however, it seems like it works as expected. Another strange thing is that it works as expected for oauth'ing in with Apple on all devices.

Wondering if anyone else has run into this issue and if y'all have a suggestion?

Where I instantiate the hub listener:

  useEffect(() => {    // NOTE: amplify hub listener    const listener = async (data: any) => {      switch (data.payload.event) {        case "signIn":        case "cognitoHostedUI":          await signInUser();          break;        case "signOut":          setUser(null);          break;        default:          break;      }    };    Hub.listen("auth", listener);  }, []);

My google oauth button component:

export function GoogleSignInButton({ title }: GoogleSignInButtonProps) {  return (<SocialIcon      button      type="google"      title={title}      style={{ padding: 50, marginBottom: 10 }}      onPress={() =>        Auth.federatedSignIn({          provider: "Google" as any,        }).catch(federatedSignInError => {          console.log({ federatedSignInError });          throw new Error(federatedSignInError);        })      }    />  );}

I'm also using the react-native-inappbrowser-reborn npm package to have an internal webview when signing in, if that's relevant:

async function urlOpener(url: string, redirectUrl: string) {  await InAppBrowser.isAvailable();  const { type, url: newUrl } = (await InAppBrowser.openAuth(url, redirectUrl, {    showTitle: false,    enableUrlBarHiding: true,    enableDefaultShare: false,    ephemeralWebSession: false,  })) as RedirectResult;  if (type === "success") {    Linking.openURL(newUrl);  }}const appsyncAuthenticationTypeOverride = {  ...config,  oauth: {    ...config.oauth,    urlOpener,  },  aws_appsync_authenticationType: "AWS_IAM",};Amplify.configure(appsyncAuthenticationTypeOverride);

How downgrade the entire project to old version React Native

$
0
0

I am using react native for developing a mobile application, Using deferent packages and "react-native": "^0.63.4", I want to downgrade my project to "react-native": "^0.60.0" and I want to downgrade all packages to support "react-native": "^0.60.0".

Is there any shortcuts to downgrade react native to older version and downgrade all other packages compatible with it

Please help me, Thanks

React Native & iOS : Api got called twice when getting the page with Push Notification

$
0
0

I have been developing this app with React Native CLI and I am using Firebase for iOS Push Notification.

Here is the flow.

App.js => SplashPage.js => AuthPage.js

We have this API, says "auth/example", in the AuthPage. It is called in useEffect.So every time I press the push notification, it will go to the AuthPage and call the API.

So

What happened is - When the app is not close completely, then a push notification comes and then we press it. The "auth/example" API got called twice.

useEffect(() => {    setTimeout(()=>{        setIsStarted(true);    }, 150)    // Timeout to close this page in a certain amount of time    startSpinner(); // Loading Animation    if (client_key !== undefined && client_key !== null && client_key !== GC.MasterClientKey) {        ExampleSDK.setClientKey(client_key).finally(() => {            console.log(`change clientKey to ${clientName}[${client_key}]`);        });    }    const {routes} = navigation.dangerouslyGetState();    params.routesIndex = routes.length - 1;    const emitter = new NativeEventEmitter(ExampleSDK);    const subscription = emitter.addListener('requestAuthRequest', callback);    setAuthState("Start Authentication");    // ========================================    // ===== The API is in doStartAuth() ======    // ========================================    doStartAuth();      return () => subscription.remove();}, []);

What could be the cause of that?

FYI, it only happened on some iOS devices. And the android one works just page.Thank you.

Generate real time audio (DAC - Digital analog converter)

$
0
0

My Problem :

I only found library where you can play sound from .mp3 or basic math.

My goal is to use filters to produce the sound and play it in real time audio streaming.

Recording is an option.


I am going to try with PCM format and this library

https://github.com/clshortfuse/react-native-pcm-audio

Let's see in few months if it's working.

React-Native iOS: RevanueCat In-App Purchase Subscription

$
0
0

I am using RevanueCat In-app purchase subscription in my app. I have also created in-app purchase in app store connect and they approved also and app is live now. But when I open the app store and open my app in app store app(iPhone device) there is price instead of GET button. I don't know why they ask me for purchase before install.Every user can download that app It's free for limited data then after they can take subscription from app only.

My app has some limits to store data after that user have to take subscription. But First time when they install my app it should be free not show any price.

Please help me with this because I am new in In-App purchase.Thanks in advance.


React Native newbie. Using XCode for the native iOS part in /iOS. What do I use for javascript in root folder? What's a best-practice workflow?

$
0
0

Confused as any newbie would be!

I am a React Native newbie. Following a tutorial I created a project. I can use XCode to open the native iOS project in /iOS. What do I use for the javascript files in the root folder? Should I use a second editor for js - i.e. one of the standard js editors (Atom, vi etc). What is the best-practice workflow? Or can I accomplish everything with one editor. Advice, recommendations would be most appreciated.

CLARIFICATIOINS:To clarify my question, take the following sample project:

I want to write a react native app which opens to a table view i.e. list screen with multiple items in a list screen. When you pick one item in the list the app navigates to a details screen. Suppose the list screen is React Native and the details screen is Native iOS. I can code up the list screen using VSCode in React Native js. And then I can code the native details screen in XCode. So for the native part I can open XCode and create a fresh project. What kind of project should this be? Should it be an IOS App or am IOS framework/library? Perhaps a main app as the AppDelegate and a test harness, and a framework/library for the one View Controller screen I will need to import into my React Native project? And then how do I run this to test and debug it out end to end in the simulator? I can possibly correct and live reload the React native portion, but suppose I want to update the iOS portion, what step do I need to go back to? etc.

Expo iOS prevent enable push notification

$
0
0

I'm trying to build an iOS application using Expo. When I run expo build:ios, the build fails because that is no Push Notification Key in the project. That is no key notification under expo tag in app.json.

Why this happens?

When expo tries to build the app, it creates an identifier for the app on developer.apple.com. It auto enable Push Notification for the app. How can I disable that?

Can't you "Let Expo handle the process"?

No. Expo tries to create a new Push Key if none where specified. The Apple Developer account that I'm publishing the app has reached the limit of 2 keys.

Can't you use one of those keys?

No.

Can't you revoke one key then create another?

No. They are in use.

Help! Pardon my poor choice of words.

How to enable dark mode on react native webview?

$
0
0

One of the issues in react native webview says "On iOS the WebView automatically uses the dark-theme if the system appearance is set to dark. On Android this is not happening." also there's a PR created (which is still to be merged as of today). But wanted to know how to actually enable dark mode in ios webviews like it's mentioned. It doesn't happen automatically while toggling system level theme.

Am I missing something here?

How to set zoom level in google map according to miles in react native?

$
0
0

I have react native application using react-native-maps,in which there is a feature to display near by users based on radius chosen by user that works fine using geocode. but I am facing problem to set zoom level of Map based on user radius? if user selects maximum meter of radius then map should display whole world? How can I achieve this? to set zoom level dynamically based on radius chosen by user?

to set radius used react-native-slider, How can set zoom level on slide of slider?

Expo TrackingTransparency failing when asking for permission

$
0
0

I'm building an app for iOS using Expo and I require the use of the TrackingTransparency. For some reason when I ask for the user permission it fails with the following error:

[Unhandled promise rejection: TypeError: undefined is not an object (evaluating '_ExpoTrackingTransparency.default.requestPermissionsAsync')]at node_modules\expo-tracking-transparency\build\TrackingTransparency.js:31:7 in requestTrackingPermissionsAsyncat node_modules\regenerator-runtime\runtime.js:63:36 in tryCatchat node_modules\regenerator-runtime\runtime.js:293:29 in invokeat node_modules\regenerator-runtime\runtime.js:63:36 in tryCatchat node_modules\regenerator-runtime\runtime.js:154:27 in invokeat node_modules\regenerator-runtime\runtime.js:189:16 in PromiseImpl$argument_0at node_modules\react-native\node_modules\promise\setimmediate\core.js:45:6 in tryCallTwoat node_modules\react-native\node_modules\promise\setimmediate\core.js:200:22 in doResolveat node_modules\react-native\node_modules\promise\setimmediate\core.js:66:11 in Promiseat node_modules\regenerator-runtime\runtime.js:188:15 in callInvokeWithMethodAndArgat node_modules\regenerator-runtime\runtime.js:211:38 in enqueueat node_modules\regenerator-runtime\runtime.js:238:8 in exports.asyncat node_modules\expo-tracking-transparency\build\TrackingTransparency.js:5:41 in <global>at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatchat node_modules\regenerator-runtime\runtime.js:293:29 in invokeat node_modules\regenerator-runtime\runtime.js:63:36 in tryCatchat node_modules\regenerator-runtime\runtime.js:154:27 in invokeat node_modules\regenerator-runtime\runtime.js:189:16 in PromiseImpl$argument_0at node_modules\react-native\node_modules\promise\setimmediate\core.js:45:6 in tryCallTwoat node_modules\react-native\node_modules\promise\setimmediate\core.js:200:22 in doResolveat node_modules\react-native\node_modules\promise\setimmediate\core.js:66:11 in Promiseat node_modules\regenerator-runtime\runtime.js:188:15 in callInvokeWithMethodAndArgat node_modules\regenerator-runtime\runtime.js:211:38 in enqueueat node_modules\regenerator-runtime\runtime.js:238:8 in exports.asyncat node_modules\react-native-gradient-buttons\src\index.js:80:29 in <anonymous>at node_modules\react-native\Libraries\Pressability\Pressability.js:691:17 in _performTransitionSideEffectsat node_modules\react-native\Libraries\Pressability\Pressability.js:628:6 in _receiveSignalat node_modules\react-native\Libraries\Pressability\Pressability.js:524:8 in responderEventHandlers.onResponderReleaseat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:265:4 in invokeGuardedCallbackImplat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:476:2 in invokeGuardedCallbackat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:500:2 in invokeGuardedCallbackAndCatchFirstErrorat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:597:41 in executeDispatchat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:621:19 in executeDispatchesInOrderat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:2521:28 in executeDispatchesAndReleaseat [native code]:null in forEachat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:836:4 in forEachAccumulatedat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:2546:20 in runEventsInBatchat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:2702:18 in runExtractedPluginEventsInBatchat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:2639:35 in batchedUpdates$argument_0at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:17712:13 in batchedUpdates$1at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:2492:29 in batchedUpdatesat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:2638:16 in _receiveRootNodeIDEventat node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:2767:27 in receiveTouchesat node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunctionat node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guardat node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueueat [native code]:null in callFunctionReturnFlushedQueue

I installed the library as expo indicates here

Also, after I installed the library in my app.json appeared as a plugin

"plugins": ["expo-tracking-transparency"    ]

And when I start the app the log says:

Error: Problem validating fields in app.json. Learn more: https://docs.expo.io/workflow/configuration/• should NOT have additional property 'plugins'.

But I'm not sure if that's a real issue or I can ignore it.

The question is, what else can I do to make the tracking transparency library work?

My code where I'm requesting the permission is the following:

const logInHandler = () => {        (async () => {            const w = await requestTrackingPermissionsAsync();            console.log(w);            const { status } = await requestTrackingPermissionsAsync();            if (status === 'granted') {                login();            } else {                dispatchAlertState({                    action: SHOW_ALERT,                    message:'Permission is required in order to log in.',                    type: AlertType.error,                });            }        })();    };
Viewing all 17263 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>