Configuring Amazon Mobile Analytics and AWS Cognito in my iOS app raise some exception linked with IAM -


here error get:

awsiossdkv2 [error] awsmobileanalyticsdefaultdeliveryclient.m line:282  | -[awsmobileanalyticsdefaultdeliveryclient submitevents:andupdatepolicies:]  | unable deliver events server. response code: 0.  error message: error domain=com.amazonaws.awscognitoidentityerrordomain code=6  operation couldn’t completed.

i have authrole in iam following policy:

{   "version": "2012-10-17",   "statement": [     {       "effect": "allow",       "action": [         "mobileanalytics:putevents",         "cognito-sync:*"       ],       "resource": [         "*"       ]     }   ] } 

and 1 unauth role:

{   "version": "2012-10-17",   "statement": [     {       "effect": "allow",       "action": [         "mobileanalytics:putevents",         "cognito-sync:*"       ],       "resource": [         "*"       ]     }   ] } 

the string mention in iam under cognito-identity.amazonaws.com:aud conditions matches declared in app.

i don't problem is.

edit

the setup code (swift).

private func _configureawsservicemanager() {     let credentialsprovider = awscognitocredentialsprovider(         regiontype: config().amazonregiontype,         identitypoolid: config().amazoncognitoidentitypool)     let configuration =     awsserviceconfiguration(region: config().amazonregiontype,         credentialsprovider: credentialsprovider)     awsservicemanager.defaultservicemanager().defaultserviceconfiguration =     configuration }  private func _configuremobileanalytics() {     let mobileanalyticsconfiguration = awsmobileanalyticsconfiguration()     mobileanalyticsconfiguration.transmitonwan = true;      let analytics = awsmobileanalytics(         forappid: config().amazonmobileanalyticsappid,         configuration: mobileanalyticsconfiguration,         completionblock: nil)     _analytics = analytics } 

both called successively in appdelegate in application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) function.

edit / solution: after check happens step of creation of cognito identity pool did create role role not assigned in unauthenticated role... stupid thing, right management on aws.

the problem related cognitoidentity, not mobileanalytics. according doc, awscognitoidentityerrordomain code=6 means invalididentitypoolconfiguration.

"identity pool has no role associated given auth type (auth/unauth) or if assumerole fails."

my suggestion login aws web console -> cognito, double check settings of identity pool. , make sure regiontype matched 1 created in web console (upper right of screen): cognitoidentity current support us-east-1 , eu-west-1.

for mobileanalytics, make sure set configuration.serviceconfiguration.regiontype us-east-1 only.

http://docs.aws.amazon.com/awsiossdk/latest/constants/awscognitoidentityerrortype.html


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -