React-native-onesignal: React-native-onesignal and ios 13.1

Created on 13 Sep 2019  ·  12Comments  ·  Source: OneSignal/react-native-onesignal

Description:

We're in the process of updating react-native-onesignal in an app - react-native is version 0.55.2. The issue in short is, that we've tried updating the react-native-onesignal sdk (to 3.3.2 and 3.3.3) per the email being sent out regarding xcode 11 and iOS 13. However, when running the app on an iOS 13.1 device (iphone 7) (it is built and run with xcode 11) the app runs, it gets the popup asking for permission to send push notifications (and we accept) but we always get the following in the console and the app won't register for notifications, as in the device doesn't show up in the Onesignal dashboard:

(I do not know how to format the code, sorry )

2019-09-13 14:30:11.707798+0200 app_name[3842:145178] { userSubscriptionEnabled: true, subscriptionEnabled: false, pushToken: '{length=32,bytes=0x0586c0fd0e74336ba3129ece2d44e089...8a9649cae8640ed7}', emailAddress: null, userId: null, hasPrompted: true, notificationsEnabled: false, emailUserId: null, emailSubscribed: false }

.....

2019-09-13 14:30:26.742281+0200 app_name[3842:145201] VERBOSE: HTTP Request (OSRequestRegisterUser) with URL: https://onesignal.com/api/v1/players, with parameters: { "app_id" : "app_id", "net_type" : 0, "test_type" : 1, "ios_bundle" : "dat1.videoplatform.ios.babyapp", "tags" : { "lang" : "da" }, "device_type" : 0, "sdk_type" : "react", "sdk" : "020904", "identifier" : "{length=32,bytes=0x0586c0fd0e74336ba3129ece2d44e089...8a9649cae8640ed7}", "language" : "da-DK", "device_os" : "13.1", "game_version" : "38", "timezone" : 7200, "ad_id" : "3A2693A5-32F0-474C-B4BD-5CC5F40B511A", "notification_types" : 31, "device_model" : "iPhone9,3", "carrier" : "Telenor DK" } 2019-09-13 14:30:26.960947+0200 app_name[3842:145202] VERBOSE: network response (OSRequestRegisterUser): { errors = ( "[\"Identifier invalid format.\"]" ); success = 0; } 2019-09-13 14:30:26.961717+0200 app_name[3842:144941] ERROR: Encountered error during push registration with OneSignal: Error Domain=OneSignalError Code=400 "(null)" UserInfo={returned={ errors = ( "[\"Identifier invalid format.\"]" ); success = 0; }}

Environment

Steps to Reproduce Issue:

  1. Install version 3.3.2 or 3.3.3 of react-native-onesignal
  2. The SDK is initialized in App.js
  3. Run the app on an iphone 7 with iOS 13.1 and accept push notifications on the popup.

Anything else:

We have tried running on iOS 12.4 devices with react-native-onesignal 3.2.4 (pre-update), 3.3.2 and 3.3.3 all of which work there. It uses the old identifier format as expected. We have run the Live version of the app on an iOS 13.1 iphone 7 which works (we thought it shouldn't work). We have run the updated app with 3.3.2 and 3.3.3 which run on the emulator just fine. It gets to connect, it just doesn't get the popup asking for push permissions as expected.

We are going to try and see if we can get a device running iOS 13.0 and test there since the emulator is 13.0 and there might be a difference from there to 13.1.

For now we can't get further on our own and have already spent days running in circles.

Appreciate the help!

Help Wanted iOS

Most helpful comment

@rgomezp I was able to get this to work by adding both CoreGraphics.framework and WebKit.framework to my OneSignalNotificationServiceExtension project in XCode, as was suggested in #861. Thanks for your help!

All 12 comments

Experiencing the same issue, we are on react-native 0.59.10

Howdy,
We have just released version 3.4.1 which should fix this problem. Cheers!

Will give it a go and return with the results :)

@DanielMerbt Did you get this to work on iOS 13.1? Can you please let us know. Thanks!

We updated to the 3.4.1 SDK and tried running on the simulator and the ios 13.1 device and we get a build error, so we haven't been able to see if the original problem has been resolved. We also moved to the Xcode GM version, but the beta which we used before resulted in the exact same build error.

The new error which occurs when trying to run on sim/device is:

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_WKWebView", referenced from:
objc-class-ref in libRCTOneSignal.a(OneSignal-x86_64-master.o)
"_OBJC_CLASS_$_WKWebViewConfiguration", referenced from:
objc-class-ref in libRCTOneSignal.a(OneSignal-x86_64-master.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm wondering what else was changed in the 3.4.1 update, as we changed absolutely nothing but the react-native-onesignal SDK version.

I'm running into this same issue trying to build with SDK version 3.4.1.
Screen Shot 2019-09-19 at 12 24 50 PM

We added two new frameworks that XCode is having trouble finding. Can you please try running pod deintegrate && pod install from your ios directory?

@rgomezp I ran those and tried to build again, and am now seeing the same output as above.

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_WKWebViewConfiguration", referenced from:
      objc-class-ref in libRCTOneSignal.a(OneSignal-arm64-master.o)
  "_OBJC_CLASS_$_WKWebView", referenced from:
      objc-class-ref in libRCTOneSignal.a(OneSignal-arm64-master.o)
  "_CGAffineTransformIdentity", referenced from:
      ___49-[OSInAppMessageViewController animateAppearance]_block_invoke in libRCTOneSignal.a(OneSignal-arm64-master.o)
  "_CGAffineTransformMakeScale", referenced from:
      -[OSInAppMessageViewController addConstraintsForMessage] in libRCTOneSignal.a(OneSignal-arm64-master.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Can you please try following these instructions?

https://documentation.onesignal.com/docs/react-native-sdk-setup#section-manually-updating-ios-onesignalnativesdk

iOS native repo: https://github.com/OneSignal/OneSignal-iOS-SDK

EDIT: folks have resolved this by adding the missing frameworks directly to their project (non-cocoapods): https://github.com/geektimecoil/react-native-onesignal/issues/861

@rgomezp I was able to get this to work by adding both CoreGraphics.framework and WebKit.framework to my OneSignalNotificationServiceExtension project in XCode, as was suggested in #861. Thanks for your help!

Fixed the issue by adding the Webkit.framework manually. The app runs and onesignal works :)

Great to hear

Was this page helpful?
0 / 5 - 0 ratings