Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AWSServiceConfiguration *serviceConfiguration = [[AWSServiceConfiguration alloc] initWithRegion:CognitoIdentityUserPoolRegion credentialsProvider:nil];
- AWSCognitoIdentityUserPoolConfiguration *userPoolConfiguration = [[AWSCognitoIdentityUserPoolConfiguration alloc] initWithClientId:self.CognitoIdentityUserPoolAppClientId clientSecret:self.CognitoIdentityUserPoolAppClientSecret poolId:self.CognitoIdentityUserPoolId];
- [OverideAWSCognitoIdentityUserPool registerCognitoIdentityUserPoolWithConfiguration:serviceConfiguration userPoolConfiguration:userPoolConfiguration forKey:@"UserPool"];
- self.Pool = [OverideAWSCognitoIdentityUserPool CognitoIdentityUserPoolForKey:@"UserPool"];
- self.credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:CognitoIdentityUserPoolRegion identityPoolId:self.arnIdentityPoolId identityProviderManager:self.Pool];
- AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:CognitoIdentityUserPoolRegion credentialsProvider:self.credentialsProvider];
- [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;
- self.syncClient = [AWSCognito defaultCognito];
- [[self.credentialsProvider getIdentityId] continueWithBlock:^id _Nullable(AWSTask<NSString *> * _Nonnull task) {
- dispatch_async(dispatch_get_main_queue(), ^{
- if(task.error){
- NSLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!! error : %@", task.error);
- NSLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!! error : %@", task.error.userInfo);
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:task.error.userInfo[@"NSLocalizedDescription"]];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- } else {
- NSLog(@"identityId : %@", task.result);
- NSString *keyString = [options objectForKey:@"key"];
- NSString *value = [self.dataset stringForKey:keyString];
- NSLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Result value :");
- NSLog(value);
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"Initialization successful"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- }
- });
- return nil;
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement