Skip to content

Commit 9aac81b

Browse files
committed
rm push registration string 3000 error parsing
* It is not reliable to use a string check on an error message to map to a specific OneSignal error code. * Second there is only one reason you would get a 3000 error code, the push notification capability is not enabled. - The 3000 "other" error that was being reported was never a thing. - This "other" 3000 error happens when the device is not set to English. - Also recently (iOS 13 or 14) the English error message changed. * This means we will no longer see the confusing "Other Apns 3000 Error" message on the OneSignal dashboard and will now see the correct "Missing Push Capability".
1 parent a241b6a commit 9aac81b

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,15 +1603,9 @@ + (void)handleDidFailRegisterForRemoteNotification:(NSError*)err {
16031603
waitingForApnsResponse = false;
16041604

16051605
if (err.code == 3000) {
1606-
if ([((NSString*)[err.userInfo objectForKey:NSLocalizedDescriptionKey]) rangeOfString:@"no valid 'aps-environment'"].location != NSNotFound) {
1607-
// User did not enable push notification capability
1608-
[OneSignal setSubscriptionErrorStatus:ERROR_PUSH_CAPABLILITY_DISABLED];
1609-
[OneSignal onesignal_Log:ONE_S_LL_ERROR message:@"ERROR! 'Push Notification' capability not turned on! Enable it in Xcode under 'Project Target' -> Capability."];
1610-
}
1611-
else {
1612-
[OneSignal setSubscriptionErrorStatus:ERROR_PUSH_OTHER_3000_ERROR];
1613-
[OneSignal onesignal_Log:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"ERROR! Unknown 3000 error returned from APNs when getting a push token: %@", err]];
1614-
}
1606+
// User did not enable push notification capability
1607+
[OneSignal setSubscriptionErrorStatus:ERROR_PUSH_CAPABLILITY_DISABLED];
1608+
[OneSignal onesignal_Log:ONE_S_LL_ERROR message:@"ERROR! 'Push Notification' capability not turned on! Enable it in Xcode under 'Project Target' -> Capability."];
16151609
}
16161610
else if (err.code == 3010) {
16171611
[OneSignal setSubscriptionErrorStatus:ERROR_PUSH_SIMULATOR_NOT_SUPPORTED];

0 commit comments

Comments
 (0)