我正在使用解析来推送通知,我想根据设备语言发送通知 问题是如何以多语言发送通知?有办法做到这一点.. !!
请帮助
答案 0 :(得分:0)
您可以在Installation对象上存储用户语言选择。
使用iOS示例:
PFInstallation *current = [PFInstallation currentInstallation];
[current setObject:@"english" forKey:@"language"];
[current saveEventually];
然后您可以根据语言推送查询:
PFQuery *query = [PFInstallation query];
[query whereKey:@"language" equalTo:@"english"];
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
@"Yo", @"alert", @"yo.caf", @"sound", nil];
PFPush *push = [[PFPush alloc] init];
[push setQuery:query];
[push setData:data];
[push sendPushInBackground];