DeepLink support for both iOS 8 and iOS 9 - ios

I have a web-page, that will redirect to app if the iPhone does have application installed, but if the iPhone doesnot have the app installed I want it to render the view in browser.Something i have implemented is from this answer
setTimeout(function () { window.location = "https://itunes.apple.com/appdir"; }, 25);
window.location = "appname://";
This method what does is wait for 25 ms to open native app after it renders in browser...If app doesnot open then renders view in browser..
The problem is it used to work fine in iOS 8..But while testing on iOS 9 ,I get this pop up as
"Open this page in APP".
So user is not able to tap on popUp and app doesnot get notified.After some seconds the popup disappears and view renders in browser..
How do i handle this behaviour?
Or is there any other way i should think of ?

In iOS 9, Apple changed the 'Open App' modal from a Javascript blocking modal to a non-blocking modal. When you try to open up the app, the modal will no longer block Javascript from executing, meaning that the fallback redirect to the App Store will execute immediately before the user can click 'Open App'
Here is a good read about the change Apple made in it's URI scheme. There is a workaround in that reference as well. It should help you.

Related

Universal link with branch.io doesnt work with iPhone when it works with iPad

My App is in production now, and within my app I create a Universal link using branch.io and share it to other users using for example iMessage. Example link below I got from my friend is below:
I have the app from App Store installed on both devices: iPad and iPhone. Now the above link I tap on iPad and everything is fine. My App is opened I can catch the link:)
But when I tap it on iPhone the result is following:
Why? Shouldnt it works the same way on both: iPad and iPhone? I do not know what is wrong here... Any questions? I can change and add additional info here to help the solve the problem.
This is how I defined it in dashboard of branch.io:
You are encountering a new behavior introduced with iOS 10.3. The pop-up you are seeing will open the app now only if the user responds to the pop-up alert affirmatively. You must have not yet updated your iPad.
There is an unexpected issue with this new behavior beyond the obvious:
if the user taps "Cancel" on the pop-up alert, he or she will be stuck on a blank page in Safari. To improve this experience I recommend setting the $ios_passive_deepview parameter to the key of a Deepview of your choice (branch_default is the default, I believe).

Open in [MyAppName] from WKWebView

Can I achieve the Open in [MyAppName] banner using a WKWebView?
Open in MyAppName
I have submitted an app [written in Swift] which prompts the user to sign in to a google account through Safari and open a .csv file of a report. When the report is opened the user is presented with the Open in [MyAppName] banner. They click it, the app launches with the contents of the URL and it all works perfectly.
Apple have rejected the app saying that navigating the user to Safari is a 'poor user experience' and suggest I use a Safari View Controller. As this is available for iOS9+ and I want to target iOS8+ I am looking to use a WKWebView but I can't seem to get the Open in [MyAppName] banner to appear. I'm not aware that this functionality is even possible with WKWebView.
I've messaged Apple to ask them but I find them so slow to reply.
Thanks in advance
Steve

How can I capture the 'Cancel' on the deep linking system popup iOS 9?

When using the deep linking feature in iOS 9, the first new system popup is displayed that says '{your app} would like to open Facebook' there is also a popup that accompanies the call back 'Facebook would like to open {your app}'
I have whitelisted the FB URL's so that if user pushes 'OK' everything works fine... However, in order to improve my apps workflow, I need to be able to handle if the user presses 'Cancel' on the initial popup.
How can I capture if user presses 'Cancel' on the new iOS 9 deep linking system popup(s)?
I am building using Xcode 6.4 and Facebook SDK 4.5

Windows phonegap app certification failed due to wrong back button handling

I have developed a windows app using jQuery Mobile and Phonegap. The app works fine in windows phone. But when I submitted it in windows store, the certification failed due to the failure in app certification requirements for windows phone 5.2.4.2 http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh184840(v=vs.105).aspx. It says that when they press the back button of the device from the home screen, the app is not closed rather it moves to the login screen.
My first screen is login screen. After logged in, the home screen is shown. If I press the back button of the device, the login page is shown again. But windows phone needs to close the app from the home rather moving to login screen.
There is no phonegap API available to close a windows application so I can't manage it in the javascript.
There is an exitApp() function available for android and it works fine. But it won't work with windows phone
I can't submit the app again and publish it until I fix the issue with back button.
Anyone faced a problem like this?
If so, Please help
Thanks
Have you tried this?
navigator.app.exitApp() is not working
Not sure if you finally resolved this issue. I had a similar problem which i fixed in index.js by
removing the event listener attached to the 'backbutton' event. Like this:
if (page == loginScreen)
document.removeEventListener("backbutton", yourMethod, false);
else
document.addEventListener("backbutton", yourMethod, false);
removeEventListener will allow the default PhoneGap backbutton press to exit the app.

Ext.device.Device.scheme is always false on launching Sencha Touch Native iOS app with custom URL scheme

Summary: successfully created a native iOS app in Sencha Touch 2.1 (and 2.2alpha) with a custom URL scheme. In both iOS Simulator and on a real device, launching the app from cold using the custom URL does not pass the URL to the app (Ext.device.Device.scheme is always false, regardless of whether you start the app using the custom URL or not). If the app is already running in the background, however, then the custom URL used to resume it is successfully passed to the schemeupdate event. The launching-from-cold behavior is not consistent with the documentation, and I need a workaround to get the custom URL when the app is started from cold.
Details:
Following the instructions at http://docs.sencha.com/touch/2-1/#!/api/Ext.device.Device to specify a Custom Scheme URL for my native iOS app. I am building on OS X Lion with XCode 4.5.1.
This occurs on both Sencha Touch 2.1 and 2.2alpha and on both iOS 5 and iOS 6.
Steps to reproduce:
Generate a new app using:
$ sencha generate app -path /Library/WebServer/Documents/SchemeTest
Add 'Ext.device.Device' to the requires: property of the application as per the documentation linked above.
Add the following code to the launch function in app.js:
alert("Scheme is " + Ext.device.Device.scheme);
if (Ext.device.Device.scheme) {
// the application was opened via another application. Do something:
alert('Applicaton pened via another application: ' + Ext.device.Device.scheme.url);
}
// Listen for future changes
Ext.device.Device.on('schemeupdate', function(device, scheme) {
// the application was launched, closed, and then launched another from another application
// this means onReady wont be called again ('cause the application is already running in the
// background) - but this event will be fired
alert('Applicated reopened via another application: ' + scheme.url);
}, this);
Specify a custom URL scheme by adding the following line to packager.json:
"rawConfig": "<key>CFBundleURLTypes</key><array><dict><key>CFBundleURLSchemes</key><array><string>sencha</string></array><key>CFBundleURLName</key><string>com.sencha.example</string></dict></array>"
This will cause URLs of the form sencha:HereIsMyURL to open your app on an iOS device or the iOS Simulator.
Run the app in iOS Simulator with this command:
$ sencha package run packager.json
The app will start in the iOS Simulator and will show the URL scheme to be false, since the app has not been started using a custom URL:
Click OK to close the alert dialog, then press the Home button on the iOS Simulator to move the app to the background. Open Mobile Safari and enter the URL sencha:HereIsMyURL and press Enter or click the Go button to resume the app:
The app will reopen and you will see the URL has been correctly passed in:
Tap the Home button on iOS Simulator, then double-tap the Home button and hold the mouse button down on the "My Application" icon until the icons start to shake. Use the red "-" to completely kill "My Application" so that it's no longer running:
Press the Home button again, then go back into Mobile Safari and re-enter the URL sencha:HereIsMyURL and press Enter or click the Go button to start the app.
The app will start, but Ext.device.Device.scheme is still false and so the URL cannot be retrieved.
(Optional) Configure your packager.json file with a valid applicationName, applicationId, bundleSeedId, certificateAlias and provisionProfile, and set the platform to iOS. Then rebuild your native app for your real iOS device using $ sencha package build packager.json, copy the app to your device using XCode, and repeat steps 7 through 11 on the real device. The results are the same.
This means that it is only possible to retrieve a custom URL when the app is already running in the background. When starting the app from cold using a custom URL, the app does not correctly detect that a custom URL scheme has been used and so it is not possible to pass information to the app. Does anyone know of a workaround for this?
I have filed a bug report which can be seen at http://www.sencha.com/forum/showthread.php?254153-ST-2.1-and-2.2alpha-Ext.device.Device.scheme-is-false-on-launch-from-custom-URL.

Resources