sij sij - 4 months ago 7x
iOS Question

Does APN device token depend on push notification permission

If user says no to push notification permission in the initial launch of application, will the APN device token be received by the application ?


IMPORTANT EDIT: This answer is incorrect. Please look at the answer below. I cannot delete that as it is an accepted answer.

User must give permission for you to get the device token.

If user gives permission, - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken method is executed in AppDelegate and you'll get the device token.

If user refuses to give permission, - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error method is executed and you'll only get corresponding NSError object.