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.
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.
, , , ? , , " ", , , , , - , ... , , , ... , , , ...
,
- (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); }
Source: https://habr.com/ru/post/1750714/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1750709/error-converting-anonymous-htmlattributes-to-idictionary-in-custom-helper&usg=ALkJrhhTOld6l2n0Gagy2XW9wlCvbtKDgAInsert ptr_map - c ++R: How to get stack trace from snow cover - stack-traceCan I create custom directives in ASP.NET? - asp.netDo not call subclass methods from superclass constructor - javaAn example of a complex XML file? - databaseWhat is the fastest project to download and convert a large binary file? - c ++t-sql query between event table and date range - sqlgeneric function where generic type is any interface - genericsprevent empty submissions to - jquery All Articles