Confirm iphone push input token?

I have not yet implemented push notifications in my application. I understand that the application running on the device must request a token, then send this token to my server and that my server must transfer this token to Apple when I want to send a message to the device / application.

Is the requested token specific to the application, or all applications on the device share the token?

Is there a way to verify that the token sent by the device to my server was actually created using a request in my application?

I'm worried about a possible fake when a rogue application can send a valid token to my server, which was not the token of my application. This can trick my service by sending push notifications to this device / application.

I understand that this is an unlikely scenario. I am trying to create a mechanism to verify that when my application sends information to my server, I am really talking to an instance of my application, and not some rogue client. Push notifications seem like possible ways to achieve this.

+3
source share
2 answers

Is the requested token specific to the application, or all applications on the device have a token? There is no required token for your application and each device.

, , , ? , , " ", , , , , - , ... , , , ... , , , ...

,

+10
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)dToken { 

    NSString *strToken = [NSString 
                     stringWithFormat:@"%@",dToken];

    NSLog(@"deviceToken is : %@",strToken);

    strToken = [strToken stringByReplacingOccurrencesOfString:@" " withString:@""];
    strToken = [strToken stringByReplacingOccurrencesOfString:@"<" withString:@""];
    strToken = [strToken stringByReplacingOccurrencesOfString:@">" withString:@""];

    NSLog(@"deviceToken is : %@",strToken);
}
-1

Source: https://habr.com/ru/post/1750714/