Nata Mio Nata Mio - 4 months ago 8
Objective-C Question

Parse saves unique Object wrong

Ive been trying to register username "NataMio" into channels but its being registered under channels like ["global","NataMio"]. but it supposed to be ["NataMio"], anybody faced this issue ? on Android version of my application its registering it as ["NataMio"].

PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation addUniqueObject:@"NataMio" forKey:@"channels"];
// [currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation saveInBackgroundWithBlock:^(BOOL succeeded, NSError * _Nullable error) {
// code



In your test, seems it contain "global" in default. So you can just set "channels" to ["NataMio"] directly.

Replace the following code:

[currentInstallation addUniqueObject:@"NataMio" forKey:@"channels"];


 currentInstallation.channels = @[@"NataMio"];