messaging service deviceId now different from UUIDString?

Hello,

We have been using iOS push notifications on Backendless for some time, and the messaging service deviceId has been consistent with UUIDString obtained from [[UIDevice currentDevice].identifierForVendor UUIDString]. Since updating the backendless library (static library - downloaded last week from this site) this seems to no longer be the case. Can you tell me if anything has changed, and is deviceId still derived from UIDevice?

Thanks in advance,

Rick

Reason for my question: our app needs device identifier in case user initially disallows push notifications, and then allows at a later time. This had been working fine until updating the BE library last week.

Thanks very much for any help,

Rick

I have created internal issue BKNDLSS-13677 to make investigation

Thank you, Sergey! We appreciate the help.

Rick

Hello Rick,

Please try get UUIDString in this way -

NSString *uniqueIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
[self publishMessageAsync:uniqueIdentifier];

For more information please refer to attached file.

ChatViewController.zip (1.01kB)

Hi Kirill,

Thanks very much for your reply.

We are obtaining UUIDString in exactly the same way as you describe:

NSString *installationId = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

We just ran another test (on iPhone 6 running iOS 10.2) which logged the following results:

installationId: 248465E2-E48C-4FBA-9645-6EEFF7744672

After successful registration with backendless messaging service, BE messaging console shows this value:

deviceId: 5078B7F9-0D04-4FE4-A808-204E70996B9D

The attached screenshots demonstrate the above.

Prior to our updating the BE library as described above, installationId was ALWAYS equal to BE messaging service deviceId. They are now different, and we cannot determine why.

Please let me know what you think.

Thanks again for your help.

Rick

Update:

Just dug through the latest MessagingService.m in Git repo, and it seems that BE messaging service is no longer using the original method for generating deviceId:

NSString *deviceId = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

The unique identifier now appears to be generated from bundleIdentifier and stored in the device Keychain:

KeychainDataStore *keychainStore = [[KeychainDataStore alloc] initWithService:kBackendlessApplicationUUIDKey withGroup:nil];



NSString *bundleId = [[NSBundle mainBundle] bundleIdentifier];



NSData *data = [keychainStore get:bundleId];



NSString *UUID = data?[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]:nil;



    if (!UUID) {



        CFUUIDRef uuid = CFUUIDCreate(NULL);
        UUID = (NSString *)CFUUIDCreateString(NULL, uuid);
        CFRelease(uuid);



        [keychainStore save:bundleId data:[UUID dataUsingEncoding:NSUTF8StringEncoding]];



        dispatch_async(dispatch_get_main_queue(), ^{
            [self unregisterDeviceAsync:[[UIDevice currentDevice].identifierForVendor UUIDString] responder:nil];
        });
    }

Am I correct here, and if so, is the change to this method of obtaining deviceId likely to be permanent?

Thanks in advance, and Happy Holidays!

Rick

Hello Rick,

Yes, you’re right. We have changed the generation of the unique identifier to avoid its changes after the app removing.

Regards,
Olha

Thanks very much for your reply, Olga.

Best regards,

Rick