Why is Mobilefirst 7.0 iOS App with Push Notifications Enabled Crashing? - ibm-mobilefirst

I am getting a exception in my iOS App(generated using Mobilefirst 7) which occurs after I login. The app tries to connect to the Mobilefirst Server and try to register for push notifications. The crash happens at this moment.
I am seeing a IBM ticket which was raised on this.
http://www-01.ibm.com/support/docview.wss?uid=swg1PI42699
I am getting the same exact issue.
The exception is
: -[__NSCFBoolean stringByAddingPercentEscapesUsingEncoding:]:
unrecognized selector sent to instance 0x1987b22f0 developerones-iPad
MyAppName[207] : *** WebKit discarded an uncaught exception
in the
webView:decidePolicyForNavigationAction:request:frame:decisionLi
stener: delegate: -[__NSCFBoolean
stringByAddingPercentEscapesUsingEncoding:]: unrecognized selector
sent to instance 0x1987b22f0
There is a solution in this ticket but I could not find a file named ios-gap.js. Has anyone faced the same issue.

This is a product bug.
This is as suggested by the APAR you have linked to.
The APAR is fixed.
What you need to do is to make sure you are using the latest MobileFirst Platform 7.0 iFix by visiting IBM Fix Central and download the updated Studio, then re-build your project and verify that the crash no longer occurs.

Related

MobileFirst Adapter Authorization failed after updating

I developed app for iPad, and it was working and connecting to MobileFirst(7.1) server.
But I update to 10.3.1(for Mac,iPad OS) and 8.3.2(for XCode) recently.
Then I cannot connect MobileFirst server again, and it displays error message in the console window.
[ERROR ] FWLSE0335E: Authorization failed: CliendId **************************************** was not found on the server.
But the CliendId in the console is not same as my iPad's UDID.
I don't know what the number means.
Please help me if you can solve the error or give me information!!
I deleted app on the iPad then I re-installed the app.
(It was not enough only re-installing)
I could solve the problem!
Thanks Vivin!!!

react-native send crash report with stack trace to my server

I'm building a mobile app for both android and IOS by react-native. Now I want to sent crash report with stack trace + client's info to my server (by restful api). How can I catch error which I can not handle (make app crash).
I have checked crashlytics, but it can not send log to my server.
I would recommend crashlytics despite you mentioned it. I am using it for some time now and it works great. It is worth to mention that you won't receive any logs if your app isn't built in release mode (on android).

Mobilefisrt console service notification not working

Have changed the status of my app to Active notifying in mobilefirst console, and I have tried to send custom notification message to app, but the application on device is not receiving the message sent from mobilefirst console.
In the app, we are using WL.Client.connect, and we are using adapters as well, any suggestions ?
Where can we check whether this feature is disabled in worklight?
Any mobilefirst trace that we can enable to identify the issue?
Kindly suggest.
You cannot disable the feature, it's either used (by setting the app version to Remote Notify) or not used.
The message appears only once during the application lifecycle (unless you send a different message), so make sure you didn't miss it.
Additionally, make sure that in case you have multiple versions of your app, that you are looking at the correct app version that you've sent the message to.

Worklight 6.0.0.2 javax.servlet.ServletException: Can not access development servlets in production mode

Sometime I see in my websphere proile log for Worklight have an error message:
[Servlet Error]-[DevRootServlet]: javax.servlet.ServletException: Can not access development servlets in production mode
I don't know where is error message come from? but my WL application still working fine.
Anybody can help me to fix this issue?
I'm using WL version 6.0.0.2
Thanks
Check if my answer from another similar question helps you: Worklight 6.1 - error on sending notification to android device on real server
Take a look at this part from the error message:
Caused by: javax.servlet.ServletException: Can not access development
servlets in production mode at
com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:136)
Now see the URL you are using:
http://serverIp:9080/worklighttime/dev/invoke?adapter=PushAdapter&procedure=submitNotification&parameters=[%27user%27,%27text
message%27]
The /dev/ denotes basically a "development servlet", which as the error says - cannot be used when in production. "In production" basically means "any server that is not inside Worklight Studio", Worklight Studio being the development environment.
Try to remove the /dev/ from the URL and see whether this helps, or maybe a different error will then be given.

Pebble iOS app crash when doing ajax via JavaScript framework

When loading some ajax via the PebbleKit JavaScript framework the app crashes, I can see via console.log() that the XMLHttpRequest.open() is called ok, but it doesn't get pass XMLHttpRequest.send().
I have had previous similar code working fine, but I have been unable to debug this issue.
It does not fire the onload event, nor timeout (at not that I can tell via console.log().
All I see in the pebble console is:
[ERROR ] Lost connection to Pebble
Looking at the composed url it does not appear to be malformed, and it loads ok in a desktop browser.
I can see via the iOS console (in xcode organiser), the error:
PebbleApp[211] : * Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '* -[NSURL
URLByAppendingPathComponent:]: component, components, or pathExtension
cannot be nil.'
Digging deeper in I can see that one of the querystring elements simply had a space at the end. Removing the space solved the problem, so I can assume that it was due to it not being properly URLEncoded.
I would of thought that this would typically be handled fine by JavaScript running in mobile webkit, but I'm guessing as it's embedded into an app, it is stricter and threw a exception.
Notably this is in beta 2 of the 2.0 sdk, so it may already be easier to diagnose in later versions.