devicetoken

Getting Remote Notification Device Token in Swift 4?

安稳与你 提交于 2020-07-05 07:34:32
问题 I am using this code to get the Notification Center Device token. It was working in Swift 3 but not working in Swift 4. What changed? if #available(iOS 10.0, *) { let center = UNUserNotificationCenter.current() center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in } } func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)})

Parse.com deviceToken and PFInstallation not saved

杀马特。学长 韩版系。学妹 提交于 2020-01-02 04:52:05
问题 I am encountering a weird behavior of the PFInstallation of my iOS App. On every app launch I am registering the device to receive push notifications and calling the below code on the method didRegisterForRemoteNotificationsWithDeviceToken : PFInstallation *currentInstallation = [PFInstallation currentInstallation]; [currentInstallation setDeviceTokenFromData:deviceToken]; NSLog(@"%@", currentInstallation ); [currentInstallation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if

Apple Push Notification Registration & Device Token Receive clarification?

若如初见. 提交于 2019-12-29 07:07:09
问题 I am working on an iPhone app with Apple Push Notification integration. I have some doubts on this. If the user clicked "Dont Allow" button in the APNS registration alert, will our code still receives the Device Token from APNS? I have tested that when the user switched off the notification in iPhone notification, still the app receives the Device Token from APNS? It is correct? Can anyone please clarify these doubts? 回答1: In my understanding on APNS, it doesn't depend on the user's action

Apple Push Notification Registration & Device Token Receive clarification?

有些话、适合烂在心里 提交于 2019-12-29 07:07:06
问题 I am working on an iPhone app with Apple Push Notification integration. I have some doubts on this. If the user clicked "Dont Allow" button in the APNS registration alert, will our code still receives the Device Token from APNS? I have tested that when the user switched off the notification in iPhone notification, still the app receives the Device Token from APNS? It is correct? Can anyone please clarify these doubts? 回答1: In my understanding on APNS, it doesn't depend on the user's action

ios 7 device token is different for same device

时光毁灭记忆、已成空白 提交于 2019-12-28 10:06:36
问题 I have two applications in one device. For iOS 7 both applications are sending different device tokens but for iOS 6 both apps are sending same device token. As per my understanding device token has to be same for all the application in one device. Is there something different in iOS7 than iOS 6? 回答1: UPDATE: I guess I read this one a bit too quickly. Please note my revisions. If the answer meets your use-case please feel free to accept it. Based on your description I would suggest that there

issue in getting token id in android

孤人 提交于 2019-12-25 02:18:05
问题 I know that there are lot of questions about this but I couldn't figure out the solution from those questions. I am getting null in a token from GCM. many people have done this using class, but I am doing this in background thread in same class. It returns null in regId. OnCreate if (checkPlayServices()) { gcm = GoogleCloudMessaging.getInstance(this); regid = getRegistrationId(context); if (regid.isEmpty()) { Log.e(TAG, "registering in background"); registerInBackground(); } else { Log.e(TAG,

Device token in push notification

吃可爱长大的小学妹 提交于 2019-12-22 08:10:14
问题 I want to send push notification to certain users only. From what I have gone through in Apple docs. The code to register for push notification is this - (void)applicationDidFinishLaunching:(UIApplication *)app { // other setup tasks here.... [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; } // Delegation methods - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:

Device Token Received even after iPhone is not connected to Internet

谁说胖子不能爱 提交于 2019-12-21 05:43:09
问题 I was testing my iOS app I found one interesting thing that even my phone is in airplane mode and I have also switched off WIFI, my app is able to receive the the Device Token after registering for push notification. I have also tried even after removing app and its associated certificate from the iPhone. but got same results. How is it possible, any idea ? thanks in advance. 回答1: This is from the APNS programming guide : By requesting the device token and passing it to the provider every

Is the device token as unique as the device ID?

痞子三分冷 提交于 2019-12-21 03:18:33
问题 If we reset an iPhone, the device ID remains the same. Is it the same for the device token? 回答1: I assume you are referring to the device token available to methods such as - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken If this is the case, then no, the device token can and will change . Quoted from Apples Local and Push Notification Programming Guide By requesting the device token and passing it to the provider every

Do Android GCM registration ids always start with “APA”?

心不动则不痛 提交于 2019-12-20 05:57:20
问题 In my app I have different devices registered and for the Android ones I am storing the GCM Registration Id and for the iOS I am storing the device token (push notifications). I want to distinguish when a device is iOS or Android. What is the easiest way to do it? Do Android GCM RegIds start always with string "APA"? 回答1: In short no. If you need to distinguish between Android and iOS clients, include a platform identifier (eg: platform: Android) along with the InstanceID token when sending