Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question]: APNS Delegate Never Fired #1484

Closed
1 task done
willbonde opened this issue Feb 6, 2023 · 4 comments
Closed
1 task done

[question]: APNS Delegate Never Fired #1484

willbonde opened this issue Feb 6, 2023 · 4 comments

Comments

@willbonde
Copy link

willbonde commented Feb 6, 2023

How can we help?

Hello,

I'm running into the "APNS Delegate Never Fired" issue and banging my head up against the wall trying to solve it. I'm running the app in the Simulator - the device is iPhone 14 Pro running iOS 16.2

On the OneSignal Settings page, I see this when I click Checked Subscribed Users:

Remove any other notification SDK and push code from your app.The SDK never received a response from Apns.
Remove any other notification SDK and push code from your app. The SDK never received a response from Apns.

As far as I know, I do not have any installed. I previously had react-native-permissions installed (I need to access the microphone in my app, and used it for that). I removed it to ensure its notifications permissions functionality was not causing a conflict. No difference.

In my podfile, sibling to my app's target, I have:

target 'OneSignalNotificationServiceExtension' do
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
end

In my index.js:

const ONESIGNAL_APP_ID = 'REDACTED-BUT-VERIFIED-CORRECT';

// OneSignal Initialization
OneSignal.setAppId(ONESIGNAL_APP_ID);

// promptForPushNotificationsWithUserResponse will show the native iOS or Android notification permission prompt.
// We recommend removing the following code and instead using an In-App Message to prompt for notification permission (See step 8)
OneSignal.promptForPushNotificationsWithUserResponse();

//Method for handling notifications received while app in foreground
OneSignal.setNotificationWillShowInForegroundHandler(notificationReceivedEvent => {
  let notification = notificationReceivedEvent.getNotification();
  const data = notification.additionalData
  // Complete with null means don't show a notification.
  notificationReceivedEvent.complete(notification);
});

//Method for handling notifications opened
OneSignal.setNotificationOpenedHandler(notification => {
  log.debug("OneSignal: notification opened:", notification);
});

OneSignal.setLogLevel(6 , 0);

Verbose log output:

2023-02-05 21:25:48.915949-0500 appname[39887:6714223] [native] Invalidating <RCTCxxBridge: 0x7fd854707c20> (parent: <RCTBridge: 0x600001c98fc0>, executor: (null))
2023-02-05 21:25:48.917186-0500 appname[39887:6715788] VERBOSE: RCTOneSignalEventEmitter did stop observing
2023-02-05 21:25:48.944362-0500 appname[39887:6714223] VERBOSE: Initialized RCTOneSignalEventEmitter
2023-02-05 21:25:49.949973-0500 appname[39887:6714633] [native] Manifest does not exist - creating a new one.

(null)
2023-02-05 21:25:50.217058-0500 appname[39887:6714635] VERBOSE: RCTOneSignalEventEmitter did start observing
2023-02-05 21:25:50.270697-0500 appname[39887:6714633] VERBOSE: setAppId(id) called with appId: REDACTED-BUT-VERIFIED-CORRECT!
2023-02-05 21:25:50.270863-0500 appname[39887:6714633] VERBOSE: setAppId(id) finished, checking if launchOptions has been set before proceeding...!
2023-02-05 21:25:50.270984-0500 appname[39887:6714633] VERBOSE: setAppId(id) successful and launchOptions are set, initializing OneSignal...
2023-02-05 21:25:50.272556-0500 appname[39887:6714633] VERBOSE: registerForPushNotifications Called:waitingForApnsResponse: 1
2023-02-05 21:25:50.272936-0500 appname[39887:6714633] VERBOSE: registerUser:waitingForApnsResponse: 1
2023-02-05 21:25:50.273116-0500 appname[39887:6714633] VERBOSE: registerUser:initializationTime: 2023-02-06 02:22:00 +0000
2023-02-05 21:25:50.273231-0500 appname[39887:6714633] VERBOSE: registerUserNow
2023-02-05 21:25:50.273376-0500 appname[39887:6714223] VERBOSE: registerUserInternal
2023-02-05 21:25:50.273665-0500 appname[39887:6714633] VERBOSE: registerForPushNotifications Called:waitingForApnsResponse: 1
2023-02-05 21:25:50.273725-0500 appname[39887:6714223] VERBOSE: shouldRegisterNow:waitingForOneSReg: 0
2023-02-05 21:25:50.273908-0500 appname[39887:6714223] VERBOSE: shouldRegisterNow:isImmediatePlayerCreateOrOnSession: 0
2023-02-05 21:25:50.274101-0500 appname[39887:6714633] VERBOSE: Notification will show in foreground handler set successfully
2023-02-05 21:25:50.274197-0500 appname[39887:6714223] VERBOSE: shouldRegisterNow:isOnSessionSuccessfulForCurrentState: 1
2023-02-05 21:25:50.274347-0500 appname[39887:6714633] VERBOSE: Notification opened handler set successfully

2023-02-05 21:25:50.327497-0500 appname[39887:6714223] VERBOSE: updateNotificationTypes called: 15
2023-02-05 21:25:50.327622-0500 appname[39887:6714223] VERBOSE: startedRegister: 1
2023-02-05 21:25:50.327796-0500 appname[39887:6714223] VERBOSE: getNotificationTypes:mSubscriptionStatus: -1
2023-02-05 21:25:50.327939-0500 appname[39887:6714223] VERBOSE: getNotificationTypes:mSubscriptionStatus: -1
2023-02-05 21:25:50.363018-0500 appname[39887:6714223] VERBOSE: updateNotificationTypes called: 15
2023-02-05 21:25:50.363151-0500 appname[39887:6714223] VERBOSE: startedRegister: 1
2023-02-05 21:25:50.363326-0500 appname[39887:6714223] VERBOSE: getNotificationTypes:mSubscriptionStatus: -1
2023-02-05 21:25:50.363460-0500 appname[39887:6714223] VERBOSE: getNotificationTypes:mSubscriptionStatus: -1
2023-02-05 21:25:50.363547-0500 appname[39887:6714223] VERBOSE: Prompt For Push Notifications Success

My certificates with Apple were regenerated today, and expire over a year from now. They are Production and Sandbox certificates.

Versions:

  • React-Native 0.70.6
  • Xcode 14.2
  • macOS 12.6, Intel MacBook Pro
  • react-native-onesignal 4.5.0

Thanks,

Will

Code of Conduct

  • I agree to follow this project's Code of Conduct
@stilllovinnero
Copy link

We have the same problem in production. It is really hard to track down the problem, as there is no consistency to what devices and iOS Versions are affected by this. It seems to be a problem with about 50% of installs.

@MMavrisPaleBlue
Copy link

We have the same problem in production. It is really hard to track down the problem, as there is no consistency to what devices and iOS Versions are affected by this. It seems to be a problem with about 50% of installs.

Did you find any solution to this?

@austinGENEreeve
Copy link

Seeing a high volume of subscribers with the same issue

@jennantilla
Copy link
Contributor

Hello everyone! Apologies that this issue has gone stale.

"APNS Delegate Never Fired" is a timeout message for when iOS doesn't fire a success or failure message if a connection is not made to Apple's APNS servers. We have a comprehensive guide here that covers troubleshooting steps.

Since it has been some time since this issue has seen any activity, I'm going to close it out. However, if anyone is still having trouble with this on our latest SDK version, please open a new issue and we will be happy to assist!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants