I'm currently using IBM MobileFirst Platform 8.0. and Datapower as reverse proxy server.
I have implemented Challenge handler as given in
https://mobilefirstplatform.ibmcloud.com/blog/2016/06/17/datapower-integration/
Everything is working fine for iPhone 7 Plus and iPhone 6 plus but whenever I am running application on other iPhone (iPhone 6 or iPhone 6s) below method never getting called -
dataPowerChallengeHandler.canHandleResponse = function(response) {
if (!response || response.responseText === null) {
return false;
}
var indicatorIdx = response.responseText.search('j_security_check');
if (indicatorIdx >= 0) {
return true;
}
return false;
};
Is there any difference in Plus and other iPhones?
I am using MFP Platform version - 8.0.0.00-20170131-101344
XCode version 8.0
ios version 10.0
I do not recollect any specific known issue here w.r.t Iphone version.
To help you further, can you clarify the following
Have you tried the sample as it is from the blog and did that work ?
2.Can you share the wireshark trace from datapower gateway , and if you see any difference in the flow between the devices ?
Related
Details of Project :
Application Framework - Ionic V3.0
IBM MobileFirst server(devKit) - Product version: 8.0.0.00-20170911-123510
Application Mobilefirst version -
config.xml -
mfp:platformVersion -8.0.0.00-20170218-003050
plugin name="cordova-plugin-mfp" spec="8.0.2017021815"
It's working fine in android. But in IOS, after finishing of soft update, application screen goes blank (black screen). After killing and restart of application, it's started working fine.
I have implement Direct update feature in mobilefirst 8 application as below :
// Direct Update - Used to trigger a request to the MobileFirst Server, to check for updated web resources.
WLAuthorizationManager.obtainAccessToken()
.then(
function () {
console.log("*** Obtained token successfully.");
},
function () {
console.log("*** Failed obtaining token.");
}
);
Reference : https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/direct-update/#secure-direct-update
This is perhaps has to do with the fact that Ionic now uses the WKWebView by default. See https://ionicframework.com/docs/wkwebview/
And it is a known limitation with MobileFirst Direct update on the WKWebview. See https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/product-overview/release-notes/known-issues-limitations/#wkwebview-support-for-ios-cordova-applications
As mentioned in the above link, use the wkwebview-engine-localhost plugin to ensure Direct update continues to work.
It's fixed in latest IBM MobileFirst version.
MobileFirst 7.1 hybrid app on Android devices with Google Security patch 2017-07-01 are throwing a "URIError: URI malformed" error at line 123 of worklight.js
The hybrid app works fine on iOS devices and Android devices without the 2017-07-01 security patch.
Is anyone else encountering issues with MobileFirst hybrid apps on Android after this patch is installed?
Is there a work-around for this or an IBM fix?
We were able to work around this by forcing the responses from adapter calls to be UTF-8 like this;
function adapterProcedure(input) {
var rtn = WL.Server.invokeHttp(input);
rtn = JSON.parse(unescape(encodeURIComponent(JSON.stringify(rtn))));
return rtn;
}
i have an app that its configured to receive remote notifications. Before iOS 10 release everything was working fine on iOS and WatchOS side (push notification uses localised message and custom sound)
After release of iOS 10 and WatchOS 3 i had to add code that asks for push permissions using UserNotification framework (otherwise system will not provide push token, even tho old code isn't deprecated)
Worst of all if i have my watch app running when remote notification arrives - watches will reboot with apple logo. So push notification isn't crashing app itself, it crashes whole watch OS. Any ideas?
Have you checked your app capabilities and certificates are all OK?
I have a similar setup for one of my apps (using remote notifications), and I haven't needed to update the notification registration code to use the new UserNotification framework - it works as before on iOS10.
Xcode 8 is slightly different in how it tries to help manage your certificates and maybe something got messed up?
I was having the same issue, and the thing causing crash was "url" value of user info being null. I asked my back-end dev to make it just empty string and everything worked
Found a problem. Following payload causes Apple Watch to reboot
{
aps = {
alert = {
"loc-args" = (
Test,
"<null>",
Test,
4147
);
"loc-key" = "test";
};
category = "test";
sound = default;
};
}
If i replace "<null>" with " " - crash will go away
How can I check wheather device has connected to internet using IBM Worklight
Yes.
Worklight provides the following API method: WL.Device.getNetworkInfo
For example, check for Internet connection on application startup and do actions based on the result.
In common\js\main.js:
function wlCommonInit() {
WL.Device.getNetworkInfo(function (networkInfo) {
alert (networkInfo.isNetworkConnected);
if (networkInfo.isNetworkConnected) { // if true, then
// connect to the Worklight Server or do something else...
}
});
IBM provides a Knowledge Center with complete API reference and more.
Please review it.
My question is about private API in IOS. Is there some API to manage WiFi connection? For example I'm using Apple80211.framework to scan WiFi networks but it's unusable for connecting.
My app isn't for appstore.
We can programmatically connect wifi networks after iOS 11 public API. You can connect wifi using SSID and password like following.
Swift
var configuration = NEHotspotConfiguration.init(ssid: "wifi name", passphrase: "wifi password", isWEP: false)
configuration.joinOnce = true
NEHotspotConfigurationManager.shared.apply(configuration) { (error) in
if error != nil {
//an error occurred
print(error?.localizedDescription)
}
else {
//success
}
}
Don't forget import NetworkExtension.
I ran into this issue last year and after quite a bit of digging I came across a helpful example called SOLStumbler. For this app to work your device must be jailbroken. I modified SOLStumbler and threw up a sample app on github. It uses the IPConfiguration bundle to access Apple80211 framework, which allows you to associate to a network. The readme contains the custom build instructions.
https://github.com/devinshively/wifiAssociate
No need for private API any more! With iOS 11, Apple provided a public API you can use to programmatically join a WiFi network without leaving your app.
The class you’ll need to use is called NEHotspotConfiguration.
To use it, you need to enable the Hotspot capability in your App Capabilities (Adding Capabilities). Quick working example :
NEHotspotConfiguration *configuration = [[NEHotspotConfiguration
alloc] initWithSSID:#“SSID”];
configuration.joinOnce = YES;
[[NEHotspotConfigurationManager sharedManager] applyConfiguration:configuration completionHandler:nil];
This will prompt the user to join the “SSID” WiFi network. It will stay connected to the WiFi until the user leaves the app.
This doesn't work with the simulator you need to run this code with an actual device to make it work.
More informations here :
https://developer.apple.com/documentation/networkextension/nehotspotconfiguration
It's possible in any version of iOS which can load a configuration profile: the app needs to generate a profile with the desired network credentials, and host a web server which provides the profile to Mobile Safari.