Parse platform API请求/推送通知
我在“DidRegisterForRemotonification”中做了以下工作 由于此功能在每次应用程序启动时都会执行-我的问题是,此功能是否计入req/s计数 如果是这样,这将保存我的req/s计数-这是否仍然可靠:Parse platform API请求/推送通知,parse-platform,Parse Platform,我在“DidRegisterForRemotonification”中做了以下工作 由于此功能在每次应用程序启动时都会执行-我的问题是,此功能是否计入req/s计数 如果是这样,这将保存我的req/s计数-这是否仍然可靠: PFInstallation *currentInstallation = [PFInstallation currentInstallation]; if (![[currentInstallation valueForKey:@"deviceToken"] isEqua
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
if (![[currentInstallation valueForKey:@"deviceToken"] isEqualToString:
[[[[NSString stringWithFormat:@"%@", deviceToken]
stringByReplacingOccurrencesOfString:@" " withString:@""]
stringByReplacingOccurrencesOfString:@"<" withString:@""]
stringByReplacingOccurrencesOfString:@">" withString:@""]]) {
[currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
NSLog(@"Device token updated! %d", succeeded);
}];
} else {
NSLog(@"DEVICE TOKEN UNCHANGED");
}
PFInstallation*currentInstallation=[PFInstallation currentInstallation];
如果(![[currentInstallation valueForKey:@“deviceToken”]为等效字符串:
[[NSString stringWithFormat:@“%@”,deviceToken]
StringByReplacingOfString:@“with String:@”]
StringByReplacingOfString:@“with string:@”“]]发生){
[currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation SaveInBackgroundithBlock:^(布尔成功,N错误*错误){
NSLog(@“设备令牌已更新!%d”,成功);
}];
}否则{
NSLog(@“设备令牌未更改”);
}
我正在尝试使用parse.com作为大型应用程序(300-700k活动uniq设备)的推送服务-我没有使用parse核心部分-因此我正在尝试评估30/s免费模式是否符合我的要求
如果达到req限制,则在DidRegisterForRemotionTificationsSwithDeviceToken中会发生什么
关于通常[currentInstallation saveInBackground]将计入网络api计数器-这与将任何其他对象保存到数据库相同,您可以通过检查令牌是否已更改并仅发送更新来进行优化(我不知道parse SDK是否为您执行此操作) 但是请记住,req/s是按分钟强制执行的,而不是每秒钟,因此不是30 req/s,而是1800 req/min,这为用户数量提供了更大的余量:-) 当达到限制时,溢出的请求将被丢弃。例如,您可以重试该请求……我认为saveInBackground或savefinally都会重试
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
if (![[currentInstallation valueForKey:@"deviceToken"] isEqualToString:
[[[[NSString stringWithFormat:@"%@", deviceToken]
stringByReplacingOccurrencesOfString:@" " withString:@""]
stringByReplacingOccurrencesOfString:@"<" withString:@""]
stringByReplacingOccurrencesOfString:@">" withString:@""]]) {
[currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
NSLog(@"Device token updated! %d", succeeded);
}];
} else {
NSLog(@"DEVICE TOKEN UNCHANGED");
}