0

This is hard question. )

Every time when we installing app, we get DeviceID for backend, they send to us Pushes with this information. So we using

        var deviceId = UIDevice.current.identifierForVendor?.uuidString

When user install our app on another device, we got new deviceID, so user got 2 deviceID and 2 pushes will be send for 1 action.

Next step, if our user deleting app from phone, and after this reinstalled, our app get new deviceID for the same user last paragraph Apple. So backend now got 3 deviceID but only on 2 devices. Backend thinking that user just enter on new device, but this is wrong, and now with 1 push from backed we receive 1 push for second device, and 2 similar pushes for first one. If user reinstall our app 10 times, this means that he will receive 1 push 10 times. because we got 10 different deviceID. So, can somebody explain how to do this correct, or can somebody share with any additional information) We receive notification in

- (void)application:(UIApplication *)application
    didReceiveRemoteNotification:(NSDictionary *)userInfo
    fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {

This is standard Notifications from Apple Notification Center. Thanks a lot! Plus, please can somebody help with other my questions: Set delay for receive notifications and load app swift

Maybe anybody can help with information for our backend developer.

Sergey Udalov
  • 75
  • 1
  • 7
  • Are you talking about custom push notifications from your backend or Apple Push Notifications? – mxlhz Jul 30 '21 at 08:41
  • 2
    the device's identifierForVendor is an excellent way of identifying the device. It will change if the app or all apps from the same developer is removed from the device and reinstalled. You could also write your own UUID to the keychain - that survives delete/reinstall of the app...You could also write something to the user's iCloud key-value file. That would be user-specific rather than device-specific. It also survives delete/reinstall. I think that is what you want. – Muhammad Nawaz Jul 30 '21 at 08:47
  • Hi @mxlhz, I've updated question with additional information, – Sergey Udalov Jul 30 '21 at 08:51
  • Hi @MuhammadNawaz, thanks a lot for your response! Please can you share with any resources with any additional steps to do this. Great! – Sergey Udalov Jul 30 '21 at 08:52
  • @СергейУдалов this below link may helps you that how to add uuid in keychain https://stackoverflow.com/questions/27739719/how-to-save-uuid-in-the-keychain-ios – Muhammad Nawaz Jul 30 '21 at 09:00

0 Answers0