I can't currently invoke a lambda in Swift using AWS Mobile Helper.
I've succeed to configure my project to identify user using Cognito User Pools and Cognito Federated Identities.
But now invoking lambda function lead to a crash:
terminating with uncaught exception of type NSException
Before crash there are the following log:
AWSiOSSDK v2.4.11 [Debug] AWSInfo.m line:122 | -[AWSServiceInfo initWithInfoDictionary:checkRegion:] | Couldn't read the region configuration from Info.plist for the client. Please check your `Info.plist` if you are providing the SDK configuration values through `Info.plist`.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The service configuration is `nil`. You need to configure `Info.plist` or set `defaultServiceConfiguration` before using this method.'
And here is the code:
let lambda = AWSLambda.defaultLambda()
lambda.invoke(myRequest, completionHandler: {
(myAnswer: AWSLambdaInvocationResponse?, error: NSError?) in
print("ERROR HERE: \(error)")
let payload = myAnswer?.payload
print("PAYLOAD HERE: \(payload)")
})
If you are using the Mobile Hub or Mobile Hub Helper you should use the classes that it provides. When you instantiate the CloudLogic singleton it sets the service configuration up.
So rather than AWSLambda.defaultLambda you should use AWSCloudLogic.defaultCloudLogic it's methods will manage the permissions issues as soon as it is instantiated.
You can get an example by using the mobile hub to download a sample app that uses cloud logic.
I put together a brief diagram of the mobile hub
mobile hub diagram
Related
While working with HERE-SDK for flutter, HerePositioningClient fails to initialize with the error:
onInitializationFailed. API token that failed: com.here.services.location.LocationServices$1#2bdef2b
Additionally, the ActivityThread throws this error:
E/ActivityThread(12002): Service com.here.services.internal.LocationService has leaked IntentReceiver com.here.odnp.util.AlarmTimer$Scheduler#163882d that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread(12002): android.app.IntentReceiverLeaked: Service com.here.services.internal.LocationService has leaked IntentReceiver com.here.odnp.util.AlarmTimer$Scheduler#163882d that was originally registered here. Are you missing a call to unregisterReceiver()?
Update:
Fixed this issue by adding all the possible permissions required as in the example files provided. Just adding Location and Activity permission was not enough.
I can't get Realm (lastest version), Swift and Sandboxing to work.
I created a Hello Word app with RealmSwift / Realm embedded binaries included correctly.
import RealmSwift
..add one class and only the line:
let realm = try! Realm ()
Then I got this error when I run the app:
*2016-08-17 21:04:05.404 testprosjekt1[37407:21624950] ***storageTaskManagerExistsWithIdentifier:withIdentifier failed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.nsurlstorage-cache was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.}; {
NSDebugDescription = "The connection to service named com.apple.nsurlstorage-cache was invalidated.";
}
2016-08-17 21:04:05.412 testprosjekt1[37407:21624950] ***cachedResponseDictionaryForRequest:key:handler failed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.nsurlstorage-cache was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.}; {
NSDebugDescription = "The connection to service named com.apple.nsurlstorage-cache was invalidated.";*
}
If I turn off sandboxing - I got NO error at all.
So, my question is: Is the latest version of Realm NOT working with sandboxed apps?
I have tried set Read / write on to all the directories in sandboxing, but this does not help.
I use xCode 7.3
Realm works well with sandboxing (until you try to reader or write to a directory you don't have access to).
Realm collects anonymous analytics and checks for updates when your app is run with a debugger attached, or when it runs in a simulator. This call does not run when your app is in production, or running on your user’s devices. See more at FAQ.
Also if you perform any network calls in your app add com.apple.security.network.client to your entitlement (or simply enable Outgoing connection (Client) in Capabilities tab of your project's settings).
I have an android app based on the bluelist app for bluemix BMS service. it stopped working yesterday when the stack is moved to cflinuxfs2.
Today I checked my ios app on the same bluemix service, it is working. so I looked into the exception on Android, it is from MFPush, looks like a context is null. see the attached image for the line of code where the NPE is thrown.
The stacktrace is: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.content.Context.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference
12-10 16:00:31.240 14482-14482/com.ibm.bluelist E/AndroidRuntime: at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush.listen(MFPPush.java:232)
12-10 16:00:31.240 14482-14482/com.ibm.bluelist E/AndroidRuntime: at com.ibm.bluelist.GroupsActivity.onResume(GroupsActivity.java:250)
12-10 16:00:31.240 14482-14482/com.ibm.bluelist E/AndroidRuntime: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1257)
12-10 16:00:31.240 14482-14482/com.ibm.bluelist E/AndroidRuntime: at android.app.Activity.performResume(Activity.java:6119)
Chances are the MFPPush SDK has not been initialized when you are attempting to call:
push.listen(notificationListener)
I suggest saving the push value:
push = MFPPush.getInstance()
Immediately after initialization or registration (whatever you feel is more appropriate) in the class.
That way you will have the appropriate initialized push instance when attempting to listen to a notification listener.
I'm using
[PFFacebookUtils loginInbackgroundWithReadPermission ...
to log in my user.
However, I received this error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[FBSDKInternalUtility validateURLSchemes]: unrecognized selector sent to class 0x10b695e40'
I have looked through all the header files; but I just cannot find a class named as FBSDKInternalUtility. Before the upgrade of Parse 1.7.2 and Facebook SDK v4, my log in system works perfectly.
Please help.
It seems like you haven't added FBSDKCoreKit.framework to your project. Add the framework and make sure that you add #import <FBSDKCoreKit/FBSDKCoreKit.h> to your file.
(Note, this seems related to this question, but is with a different flavor of the Dropbox SDK.)
Using the latest version of the Dropbox Datastore API on iOS, I am getting an exception after performing these steps:
Successfully connect my app to Dropbox
Disconnect my app from Dropbox.
Reconnect app to same, or another, Dropbox account.
Then this happens:
The console in Xcode shows this:
*** WebKit discarded an uncaught exception in the webView:
decidePolicyForNavigationAction:request:frame:decisionListener:
delegate: <NSInvalidArgumentException> -[PilotPro.SettingsTableViewController
dropboxWasLinked:]: unrecognized selector sent to instance 0x7fc489cb94d0
And then this:
[WARNING] DropboxSDK: error loading DBConnectController - Error
Domain=NSURLErrorDomain Code=-1002 "unsupported URL"
UserInfo=0x7fc48c11bc50 {NSUnderlyingError=0x7fc48c4418c0 "unsupported URL",
NSErrorFailingURLStringKey=db-***://1/connect?
oauth_token_secret=***&state=***&oauth_token=***&uid=***,
NSErrorFailingURLKey=db-***://1/connect?
oauth_token_secret=***&state=***&oauth_token=***&uid=***,
NSLocalizedDescription=unsupported URL}
I suspect I am not doing enough to disconnect Dropbox from my account, so it's conflicting with a Dropbox session somehow. Here's what I'm doing to disconnect:
//===::: Disable Dropbox :::===
DBAccountManager.sharedManager().linkedAccount.unlink()
// Shutdown and stop listening for changes to the datastores
DBDatastoreManager.sharedManager().shutDown()
DBDatastoreManager.sharedManager().removeObserver(self)
//Migrate back to local datastores
DBDatastoreManager.setSharedManager(DBDatastoreManager.localManagerForAccountManager(DBAccountManager.sharedManager()))
Any ideas? Thanks in advance.
It turns out that the errors given by Xcode were a bit of a red herring in this case. I was firing an NSNotification after Dropbox finished authenticating, and in doing so I was using this:
NSNotificationCenter.defaultCenter().addObserver(self, selector: "dropboxWasLinked:", name: "dropboxLinked", object: nil)
...but my dropboxWasLinked method wasn't set up to receive any arguments:
func dropboxWasLinked(){ ... }
So Xcode was firing an exception that messed up the authentication and made other things appear to be the cause, when in reality all I needed to do was remove the : from my selector in the NSNotification listener.
Ah, the joys of programming. :)