Applications using multiple event sources requires segmentation of users based on subscriptions.
Client
[[MFPPush sharedInstance] initialize];
[[MFPPush sharedInstance] registerDevice:^(WLResponse *response, NSError *error) {
if(error){
NSLog(@"Failed to register");
}else{
NSLog(@"Successfullyregistered");
}
}];
[MFPPush sharedInstance] unregisterDevice:^(WLResponse *response, NSError *error) {
if(error){
NSLog(@"Failed to unregister");
}else{
NSLog(@"Successfully unregistered");
}
}];
[[MFPPush sharedInstance] isPushSupported]
NSMutableArray *tags = [[NSMutableArray alloc]init];
[tags addObject:@"sample-tag1"];
[tags addObject:@"sample-tag2"];
[MFPPush sharedInstance] subscribe:tags completionHandler:^(WLResponse *response, NSError *error) {
if(error){
NSLog(@"Failed to unregister");
}else{
NSLog(@"Successfully unregistered");
}
}];
NSMutableArray *tags = [[NSMutableArray alloc]init];
[tags addObject:@"sample-tag1"];
[tags addObject:@"sample-tag2"];
[MFPPush sharedInstance] unsubscribe:tags completionHandler:^(WLResponse *response, NSError *error) {
if(error){
NSLog(@"Failed to unregister");
}else{
NSLog(@"Successfully unregistered");
}
}];
Server
You can also set up the credentials by using Update GCM settings (PUT) REST API, for Android applications or Update APNs settings (PUT) REST API, for iOS applications.