React-native-onesignal: App's push permission option disappear on iOS14 after calling `promptForPushNotifications` - `Build Settings-Packaging-Product Name`

Created on 3 Oct 2020  路  6Comments  路  Source: OneSignal/react-native-onesignal

Description:
image

App's push permission option disappear on iOS14 like above..

I didn't make any updates. But after iOS14 update, it became like the picture above. What should I do?

constructor(props) {
    super(props);
    OneSignal.init(ENV.OnesignalAppKey, {
      kOSSettingsKeyAutoPrompt: true,
      kOSSettingsKeyInFocusDisplayOption: 2,
    });
    OneSignal.inFocusDisplaying(2);
    OneSignal.addEventListener('received', this.onReceived);
    OneSignal.addEventListener('opened', (event) =>
      this.onOpened(event, this.props.navigation),
    );
    OneSignal.addEventListener('ids', this.onIds);
  }

Most helpful comment

All 6 comments

Howdy,
The option won't appear until the app is opened and the user is prompted for push. Is this happening even after that?

As a follow up, can you please try calling this method? If that doesn't fix it, then this might actually be an issue.

yes.. I've already tried that but no options have emerged.
and after iOS14, Push permission prompt doesn't show on open the app at first.
so i guess above os setting make problem.

but 1 thing more. recently i upgrade my rn version 0.62 to 0.63. Something might have gone wrong in this process.

Same here.

RN v0.62.2
iOS 14.0.1
xcode 12.0.1

OneSignal.setLogLevel(6, 0);

ERROR: Error registering for Apple push notifications! Error: (null)
Request success result {
id = "06bd7fe2-50b5-4b0f-*-7def1bf0";
success = 1;
}
VERBOSE: startedRegister: 0
VERBOSE: getNotificationTypes:mSubscriptionStatus: -16
VERBOSE: getNotificationTypes:mSubscriptionStatus: -16
VERBOSE: Prompt For Push Notifications Success
VERBOSE: Called init with app ID: 7d2576aa-0834-4092-
-1da103fd
DEBUG: Downloading iOS parameters for this application
VERBOSE: HTTP Request (OSRequestGetIosParams) with URL: https://api.onesignal.com/apps/7d2576aa-0834-4092-
-1da103fd/ios_params.js?player_id=06bd7fe2-50b5-4b0f--7def1bf0, with parameters: {
"player_id" : "06bd7fe2-50b5-4b0f-
-7def1bf0*"
}
VERBOSE: network response (OSRequestGetIosParams): {
outcomes = {
direct = {
enabled = 0;
};
indirect = {
enabled = 0;
"notification_attribution" = {
limit = 10;
"minutes_since_displayed" = 60;
};
};
unattributed = {
enabled = 0;
};
};
"receive_receipts_enable" = 1;
"uses_provisional_auth" = 0;
}

Thanks @hemith ,

From the thread:

IOS14 solved the problem by changing 'Build Settings-Packaging-Product Name' to English.
If you want to keep the existing name as it is, add the existing name to the Bundle display name in 'info.plist' and it will work as before.
I refer to the site below.
https://github.com/invertase/react-native-firebase/issues/4093

yes i solved it!! Thanks @hemith you are my guardian

Was this page helpful?
0 / 5 - 0 ratings