segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
360 stars 186 forks source link

@segment/analytics-react-native-appsflyer changes for IOS 14.* #338

Closed beqramo closed 3 years ago

beqramo commented 3 years ago

Hi, I'm trying to add support for IOS 14 and when I'm trying to run the app it throws an error. I think this is a problem because I tried to submit in an AppStore without this code and they rejected it with the error: image

the instructions that I'm trying to add: image

and actual code from AppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

  if #available(iOS 14, *) {
    // Set a timeout for the SDK to wait for the IDFA collection before handling app launch
      AppsFlyerLib.shared().waitForAdvertisingIdentifier(withTimeoutInterval: 60)
      // Show the user the Apple IDFA consent dialog (AppTrackingTransparency)
      // Can be called in any place
      ATTrackingManager.requestTrackingAuthorization { (status) in
      }
  }
}

The error: image

package.json:

    "@segment/analytics-react-native": "^1.4.9",
    "@segment/analytics-react-native-appsflyer": "^1.4.9",
    "@segment/analytics-react-native-mixpanel": "^1.4.9",
    "react-native": "0.64.1",

Thanks.

alanjcharles commented 3 years ago

Hi @beqramo can you please reach out to friends@segment.com if you are still running into issues submitting to the app store? We are attempting to limit the issues here to bugs and other unexpected behavior with the library itself. Thanks, good luck!