weixin_39896617
2020-11-27 13:54 阅读 14

iOS Black Screen after installing React-Native SDK from OneSignal.

Description:

ExpoKit 32, React Native SDK set up compiles on iOS, builds to device but I receive a black screen, with no crashes in either iOS or expo.

Environment

OneSignal installed following their official SDK instructions:

https://documentation.onesignal.com/v5.0/docs/react-native-sdk-setup#section-installation

yarn add react-native-onesignal react-native link react-native-onesignal

then updated pods with

pod 'react-native-onesignal', :path => "../node_modules/react-native-onesignal/react-native-onesignal.podspec", :inhibit_warnings => true

and

target 'OneSignalNotificationServiceExtension' do pod 'OneSignal', '>= 2.9.3', '< 3.0' end

Note, had an issue where I could not add the Binary RCTOneSignal.a to my OneSignalNotificationServiceExtension but read that it is unneeded if installing via cocoapods.

iOS app builds and runs on device, I see splash screen, (note no expo installation % at bottom of app though) and then once finished the screen goes black.

Anything else:

One thing I noticed is when adding theNotification Service Extension is that the file they ask you to change for using OneSignalNotificationServiceExtension is listed as:

Using Cocoapods "Open NotificationServiceExtension.m or NotificationService.swift and replace the whole file contents with the code below:"

However my file is listed as: NotificationService.m not NotificationServiceExtension.m

Other information listed below.

iOS output:

2019-01-18 15:33:46.449951-0800 hunch[16995:4030858] [DYMTLInitPlatform] platform initialization successful 2019-01-18 15:33:46.846663-0800 hunch[16995:4030765] You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist. 2019-01-18 15:33:46.859465-0800 hunch[16995:4030765] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2019-01-18 15:33:46.860372-0800 hunch[16995:4030765] [MC] Reading from public effective user settings. 2019-01-18 15:33:46.880531-0800 hunch[16995:4030868] [NetworkInfo] Could not successfully update network info for descriptor <CTServiceDescriptor 0x2827076a0, domain=1, instance=2> during initialization. 2019-01-18 15:33:46.882432-0800 hunch[16995:4030868] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x282707720, domain=1, instance=1> 2019-01-18 15:33:46.883309-0800 hunch[16995:4030868] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x2827076a0, domain=1, instance=2> 2019-01-18 15:33:46.934379-0800 hunch[16995:4030765] Expo iOS Runtime Version 32.0.0 2019-01-18 15:33:46.937086-0800 hunch[16995:4030883] Task <F0BA6B50-B436-4B15-A943-0D542F0212A9>.<1> finished with error - code: -1002 2019-01-18 15:33:47.005515-0800 hunch[16995:4030765] [NetworkInfo] Could not successfully update network info for descriptor <CTServiceDescriptor 0x28271d2a0, domain=1, instance=2> during initialization. 2019-01-18 15:33:47.006639-0800 hunch[16995:4030765] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x28271d2c0, domain=1, instance=1> 2019-01-18 15:33:47.007068-0800 hunch[16995:4030765] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x28271d2a0, domain=1, instance=2> 2019-01-18 15:33:47.008548-0800 hunch[16995:4030856] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x107c04b50] get output frames failed, state 8196 2019-01-18 15:33:47.008583-0800 hunch[16995:4030856] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x107c04b50] get output frames failed, state 8196 2019-01-18 15:33:47.008665-0800 hunch[16995:4030856] TIC Read Status [1:0x0]: 1:57 2019-01-18 15:33:47.009679-0800 hunch[16995:4030856] TIC Read Status [1:0x0]: 1:57 2019-01-18 15:33:47.171798-0800 hunch[16995:4030870] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x10be00200] get output frames failed, state 8196 2019-01-18 15:33:47.172075-0800 hunch[16995:4030870] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x10be00200] get output frames failed, state 8196 2019-01-18 15:33:47.172613-0800 hunch[16995:4030870] TIC Read Status [2:0x0]: 1:57 2019-01-18 15:33:47.172682-0800 hunch[16995:4030870] TIC Read Status [2:0x0]: 1:57 2019-01-18 15:33:47.686544-0800 hunch[16995:4030862] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x107f250d0] get output frames failed, state 8196 2019-01-18 15:33:47.686990-0800 hunch[16995:4030862] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x107f250d0] get output frames failed, state 8196 2019-01-18 15:33:47.688129-0800 hunch[16995:4030862] TIC Read Status [3:0x0]: 1:57 2019-01-18 15:33:47.688265-0800 hunch[16995:4030862] TIC Read Status [3:0x0]: 1:57 2019-01-18 15:34:16.946175-0800 hunch[16995:4030885] [NetworkInfo] Could not successfully update network info for descriptor <CTServiceDescriptor 0x2827186a0, domain=1, instance=2> during initialization. 2019-01-18 15:34:16.949894-0800 hunch[16995:4030885] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x282718840, domain=1, instance=1> 2019-01-18 15:34:16.950836-0800 hunch[16995:4030885] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x2827186a0, domain=1, instance=2> 2019-01-18 15:34:16.956335-0800 hunch[16995:4031003] ERROR: HTTP Request (OSRequestRegisterUser) must contain app_id parameter 2019-01-18 15:34:16.956710-0800 hunch[16995:4030765] ERROR: Encountered error during push registration with OneSignal: Error Domain=OneSignalError Code=-1 "(null)" UserInfo={error=HTTP Request (OSRequestRegisterUser) must contain app_id parameter} 2019-01-18 15:34:16.956775-0800 hunch[16995:4030765] ERROR: Encountered error during email registration with OneSignal: (null)

该提问来源于开源项目:OneSignal/react-native-onesignal

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

5条回答 默认 最新

  • weixin_39670849 weixin_39670849 2020-11-27 13:54

    it looks like you are not passing in the correct OneSignal app ID when you call OneSignal.init()

    点赞 评论 复制链接分享
  • weixin_39654067 weixin_39654067 2020-11-27 13:54

    I’ve same error with ionic

    点赞 评论 复制链接分享
  • weixin_39670849 weixin_39670849 2020-11-27 13:54

    could you post some more details, logs, etc?

    点赞 评论 复制链接分享
  • weixin_39654067 weixin_39654067 2020-11-27 13:54

    I've resolved black screen setting the "main interface". But the app not started.

    2019-01-24 09:37:46.492925+0100 HelloSpesa[17891:7766942] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/1EC39882-256F-44F7-846A-CD1DA7F9D478/Library/Cookies/Cookies.binarycookies 2019-01-24 09:37:46.670214+0100 HelloSpesa[17891:7766942] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2019-01-24 09:37:46.670446+0100 HelloSpesa[17891:7766942] [MC] Reading from public effective user settings. 2019-01-24 09:37:46.953417+0100 HelloSpesa[17891:7767010] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x10130d4b0] get output frames failed, state 8196 2019-01-24 09:37:46.953655+0100 HelloSpesa[17891:7767010] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x10130d4b0] get output frames failed, state 8196 2019-01-24 09:37:46.953860+0100 HelloSpesa[17891:7767010] TIC Read Status [1:0x0]: 1:57 2019-01-24 09:37:46.953888+0100 HelloSpesa[17891:7767010] TIC Read Status [1:0x0]: 1:57 2019-01-24 09:37:47.050731+0100 HelloSpesa[17891:7767017] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x28007dd20, domain=1, instance=1> 2019-01-24 09:37:47.069149+0100 HelloSpesa[17891:7767020] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x10131e950] get output frames failed, state 8196 2019-01-24 09:37:47.069473+0100 HelloSpesa[17891:7767020] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x10131e950] get output frames failed, state 8196 2019-01-24 09:37:47.069726+0100 HelloSpesa[17891:7767020] TIC Read Status [3:0x0]: 1:57 2019-01-24 09:37:47.069840+0100 HelloSpesa[17891:7767020] TIC Read Status [3:0x0]: 1:57 2019-01-24 09:37:47.791120+0100 HelloSpesa[17891:7766942] User accepted notifications: 1 2019-01-24 09:37:48.208645+0100 HelloSpesa[17891:7766942] FBSDKLog: initStore should have been called before calling setUserID 2019-01-24 09:37:48.214402+0100 HelloSpesa[17891:7766942] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x28006b5c0, domain=1, instance=1> 2019-01-24 09:37:48.433152+0100 HelloSpesa[17891:7767010] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C6.1:2][0x10132f370] get output frames failed, state 8196 2019-01-24 09:37:48.433346+0100 HelloSpesa[17891:7767010] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C6.1:2][0x10132f370] get output frames failed, state 8196 2019-01-24 09:37:48.433803+0100 HelloSpesa[17891:7767010] TIC Read Status [6:0x0]: 1:57 2019-01-24 09:37:48.433834+0100 HelloSpesa[17891:7767010] TIC Read Status [6:0x0]: 1:57 2019-01-24 09:37:48.593105+0100 HelloSpesa[17891:7767020] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C5.1:2][0x10132da50] get output frames failed, state 8196 2019-01-24 09:37:48.593304+0100 HelloSpesa[17891:7767020] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C5.1:2][0x10132da50] get output frames failed, state 8196 2019-01-24 09:37:48.593669+0100 HelloSpesa[17891:7767020] TIC Read Status [5:0x0]: 1:57 2019-01-24 09:37:48.593733+0100 HelloSpesa[17891:7767020] TIC Read Status [5:0x0]: 1:57

    my AppDelegate.m

    `#import "AppDelegate.h"

    import

    AppDelegate

    • (BOOL)application:(UIApplication)application didFinishLaunchingWithOptions:(NSDictionary)launchOptions {

      // Replace '11111111-2222-3333-4444-0123456789ab' with your OneSignal App ID. [OneSignal initWithLaunchOptions:launchOptions appId:@"b947140c-cbca-4ed8-b65b-29b02b82a84d" handleNotificationAction:nil settings:@{kOSSettingsKeyAutoPrompt: }]; OneSignal.inFocusDisplayType = OSNotificationDisplayTypeNotification;

      // Recommend moving the below line to prompt for push after informing the user about // how your app will use them. [OneSignal promptForPushNotificationsWithUserResponse:^(BOOL accepted) { NSLog(@"User accepted notifications: %d", accepted); }];

      return YES; }

    `

    if I restore appdelegate.m the app run correctly

    点赞 评论 复制链接分享
  • weixin_39670849 weixin_39670849 2020-11-27 13:54

    I am not sure why you are importing our native iOS SDK? This repo is for our react native SDK. You would want to initialize our SDK using JS.

    You shouldn’t have to have any OneSignal related code in your AppDelegate.

    点赞 评论 复制链接分享

相关推荐