Unauthorized: requires a master key (code: 0, version: 1.12.0) + iOS + Parse + SNS after migrating Parse to AWS

When I send a push notification from an iOS application after migrating the parsing to AWS + MongoLab, I get an error - unauthorized: a master key is required (code: 0, version: 1.12.0), how I resolve it, and I use iOS for Send notification messages and AWS SNS using the Mobile Hub.

before transferring the parsing to AWS, the push notification is sent fine, after the migration parsing clicks on aws using this link https://mobile.awsblog.com/post/Tx3NE69QDHI7LJK/Migrating-from-Parse-Push-to -Amazon-SNS , I get this error - unauthorized: a master key is required (code: 0, version: 1.12.0), even I used one signal instead of SNS to remove this error, but I get the same error, it works fine when I test the notification using step 4 of the specified link. below is my iOS syntax code that I use in the application -

PFQuery * queryInstallation = [PFInstallation query]; [queryInstallation whereKey: kESInstallationUserKey matchesQuery: query];

PFPush *push = [[PFPush alloc] init]; [push setQuery:queryInstallation]; NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys: message, @"alert", @"Increment", @"badge", @"homerun.caf", @"sound", @"m", @"p", nil]; [push setData:data]; [push sendPushInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (error != nil) { NSLog(@"SendPushNotification send error."); } }]; 

Mostly I use client-side code, but for some aspect, the cloud-side code is also used.

+5
source share

Source: https://habr.com/ru/post/1246204/


All Articles