payload: {"action":"created","issue":{"url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios/issues/1235","repository_url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios","labels_url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios/issues/1235/labels{/name}","comments_url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios/issues/1235/comments","events_url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios/issues/1235/events","html_url":"https://github.com/aws-amplify/aws-sdk-ios/issues/1235","id":410274855,"node_id":"MDU6SXNzdWU0MTAyNzQ4NTU=","number":1235,"title":"How to initialize AWSMobileClient properly in ObjC without amplify","user":{"login":"thomers","id":453568,"node_id":"MDQ6VXNlcjQ1MzU2OA==","avatar_url":"https://avatars2.githubusercontent.com/u/453568?v=4","gravatar_id":"","url":"https://api.github.com/users/thomers","html_url":"https://github.com/thomers","followers_url":"https://api.github.com/users/thomers/followers","following_url":"https://api.github.com/users/thomers/following{/other_user}","gists_url":"https://api.github.com/users/thomers/gists{/gist_id}","starred_url":"https://api.github.com/users/thomers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomers/subscriptions","organizations_url":"https://api.github.com/users/thomers/orgs","repos_url":"https://api.github.com/users/thomers/repos","events_url":"https://api.github.com/users/thomers/events{/privacy}","received_events_url":"https://api.github.com/users/thomers/received_events","type":"User","site_admin":false},"labels":[{"id":690768198,"node_id":"MDU6TGFiZWw2OTA3NjgxOTg=","url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios/labels/Cognito","name":"Cognito","color":"994d4d","default":false},{"id":106258127,"node_id":"MDU6TGFiZWwxMDYyNTgxMjc=","url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios/labels/Question","name":"Question","color":"58a600","default":false},{"id":110936561,"node_id":"MDU6TGFiZWwxMTA5MzY1NjE=","url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios/labels/Requesting%20Feedback","name":"Requesting Feedback","color":"ffe1bf","default":false}],"state":"open","locked":false,"assignee":{"login":"kvasukib","id":15204269,"node_id":"MDQ6VXNlcjE1MjA0MjY5","avatar_url":"https://avatars3.githubusercontent.com/u/15204269?v=4","gravatar_id":"","url":"https://api.github.com/users/kvasukib","html_url":"https://github.com/kvasukib","followers_url":"https://api.github.com/users/kvasukib/followers","following_url":"https://api.github.com/users/kvasukib/following{/other_user}","gists_url":"https://api.github.com/users/kvasukib/gists{/gist_id}","starred_url":"https://api.github.com/users/kvasukib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvasukib/subscriptions","organizations_url":"https://api.github.com/users/kvasukib/orgs","repos_url":"https://api.github.com/users/kvasukib/repos","events_url":"https://api.github.com/users/kvasukib/events{/privacy}","received_events_url":"https://api.github.com/users/kvasukib/received_events","type":"User","site_admin":false},"assignees":[{"login":"kvasukib","id":15204269,"node_id":"MDQ6VXNlcjE1MjA0MjY5","avatar_url":"https://avatars3.githubusercontent.com/u/15204269?v=4","gravatar_id":"","url":"https://api.github.com/users/kvasukib","html_url":"https://github.com/kvasukib","followers_url":"https://api.github.com/users/kvasukib/followers","following_url":"https://api.github.com/users/kvasukib/following{/other_user}","gists_url":"https://api.github.com/users/kvasukib/gists{/gist_id}","starred_url":"https://api.github.com/users/kvasukib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvasukib/subscriptions","organizations_url":"https://api.github.com/users/kvasukib/orgs","repos_url":"https://api.github.com/users/kvasukib/repos","events_url":"https://api.github.com/users/kvasukib/events{/privacy}","received_events_url":"https://api.github.com/users/kvasukib/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2019-02-14T12:23:52Z","updated_at":"2019-02-15T17:28:00Z","closed_at":null,"author_association":"NONE","body":"In general, what are the steps to manually initialize the AWSMobileClient from ObjC? I didn't find documentation.\r\n\r\n**Which AWS Services are you utilizing?**\r\n\r\nAWS Cognito\r\nAWS S3TransferUtility\r\n\r\n**Environment:**\r\n\r\n* SDK Version: 2.8.4\r\n* Dependency Manager: Cocoapods\r\n\r\n\r\nTo be precise:\r\n\r\nShould the configuration be stored in awsconfiguration.json or Info.plist? (Which has precedence?)\r\n\r\nDo I need to call \"initialize\"? How (from ObjC)? \r\n\r\nWhat is \"Legacy Mode\"?\r\n\r\nSome context:\r\nI am trying to get the Cognito identity id for the logged in user.\r\n`[[AWSMobileClient sharedInstance] getIdentityId]` returns this error:\r\n> The operation couldn’t be completed. (AWSMobileClient.AWSMobileClientError error 30)\r\n\r\nNote: The user pool signup and login works properly (using the AWSAuthUI)!\r\n\r\nNow, I suspected that the AWSMobileClient was not properly initialized, so I added \r\n a call to `[[AWSMobileClient sharedInstance] interceptApplication:application didFinishLaunchingWithOptions:launchOptions];` in the AppDelegate.\r\nThen, I got this error:\t\r\n> NSError *\tdomain: @\"com.amazonaws.AWSCognitoIdentityErrorDomain\" - code: 5\r\n\r\nStill, I am able to properly register and login using the AWSAuthUI! "},"comment":{"url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios/issues/comments/464132185","html_url":"https://github.com/aws-amplify/aws-sdk-ios/issues/1235#issuecomment-464132185","issue_url":"https://api.github.com/repos/aws-amplify/aws-sdk-ios/issues/1235","id":464132185,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2NDEzMjE4NQ==","user":{"login":"BillBunting","id":5861783,"node_id":"MDQ6VXNlcjU4NjE3ODM=","avatar_url":"https://avatars2.githubusercontent.com/u/5861783?v=4","gravatar_id":"","url":"https://api.github.com/users/BillBunting","html_url":"https://github.com/BillBunting","followers_url":"https://api.github.com/users/BillBunting/followers","following_url":"https://api.github.com/users/BillBunting/following{/other_user}","gists_url":"https://api.github.com/users/BillBunting/gists{/gist_id}","starred_url":"https://api.github.com/users/BillBunting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BillBunting/subscriptions","organizations_url":"https://api.github.com/users/BillBunting/orgs","repos_url":"https://api.github.com/users/BillBunting/repos","events_url":"https://api.github.com/users/BillBunting/events{/privacy}","received_events_url":"https://api.github.com/users/BillBunting/received_events","type":"User","site_admin":false},"created_at":"2019-02-15T17:28:00Z","updated_at":"2019-02-15T17:28:00Z","author_association":"NONE","body":"@thomers \r\n\r\n> \"initialize\" from AWSMobileClient.swift is not available from ObjC. I tested adding @objc, but that fails:\r\n\r\nYes, this may be the reason I decided to go the \"can't beat them, join um route.\" and put the AWSMobileClient code in swift. Yet, most everything else in my app is ObjC including all access to AWS services (DynamoDB, S3, API Gateway, etc).  I went around in circles trying to get it to work in ObjC. I'm very curious and am watching the response closely to see if I could have done things different, and more directly in ObjC.  I was also having problems with federated login (still do with Google and token refresh), so I decided I needed to be able to follow the sample code and documentation, only available in swift. \r\n\r\nWhat I concluded at the time, when using AWS 2.8.2 (and now 2.9.x), was that unless the AWSMobileClient was initialized in swift and used exclusively from swift, it created problems. \r\n\r\nSo, long and short of it, I wrote a AWSMobileClientHelper class in swift. Any time I need to access the AWSMobileClient (form Objc), it goes though swift and this class.\r\n\r\n```\r\nclass AWSMobileClientHelper: NSObject {\r\n\r\n    @objc public static func sharedAWSMobileClient() -> AWSMobileClient {\r\n        return AWSMobileClient.sharedInstance();\r\n    }\r\n    \r\n    @objc public static func enableVerboseLogging() {\r\n        //AWSDDLog.sharedInstance.logLevel = .verbose;\r\n        AWSDDLog.sharedInstance.logLevel = .warning;\r\n        //AWSDDLog.sharedInstance.logLevel = .info;\r\n        AWSDDLog.sharedInstance.add(AWSDDTTYLogger.sharedInstance);\r\n    }\r\n    \r\n    @objc public static func signOut() {\r\n        AWSMobileClient.sharedInstance().signOut();\r\n    }\r\n```\r\nand so on ... including methods to show the sign in UI posted previously. \r\n\r\nImportant part... Then, in the AppDelegate.m, I set things up as follows:\r\n\r\n```\r\n- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {\r\n    \r\n    NSLog(@\"application application: %@, openURL: %@, sourceApplication: %@\", application.description, url.absoluteURL,\r\n          sourceApplication);\r\n    \r\n    // Required for sign-in\r\n     return [[AWSMobileClientHelper sharedAWSMobileClient] interceptApplication:application openURL:url sourceApplication:sourceApplication annotation:annotation];\r\n    //return true;\r\n}\r\n```"}}
other: {"actor":{"display_login":"BillBunting"}}