2014-07-23 144 views
0

我使用解析來推送通知,我想發送通知取決於設備語言 問題是我該如何發送多語言通知?有什麼辦法可以做到這一點..!多語言解析

請幫忙

回答

0

您可以將用戶語言選擇存儲在安裝對象上。

使用的是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];