appframework app.ready not fired - appframework

I am currently using appframework MVC for mobile devices, the problem is that app.ready is not fired on android devices, but working fine on IOS devices.
Any suggestion, below is my little code:
var app = new $.mvc.app();
app.loadModels("login");
app.loadControllers("login");
app.ready(function() {
alert("I am at the app ready");
$.mvc.route("/login");//Load the default login route
});

After this, you have to throw ui
$ui.launch();

Related

Google Cast Chrome sender app isn't registering on iOS

Google Chrome browser on iOS isn't registering my Chromecast sender application. This is a recent problem (last few weeks) as it was working as expected before.
Currently works as expected on Android, MacOS, and Windows desktop. Appears to be only on iPhone/iPad that the chrome browser isn't launching on the chromecast window event.
<script>
var appID = 'appId';
window['__onGCastApiAvailable'] = function(isAvailable) {
if (isAvailable) {
console.log('cast available')
setupCast();
}
};
</script>
<script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>
Neither the above console log or one I have inside the setup cast function are getting called.
Thank you for your time.
If anyone else runs into this issue, it's because it's been removed from iPhone/Chrome as of early February 2019, with the original task dating back to November 2018:
https://bugs.chromium.org/p/chromium/issues/detail?id=872050&q=ios%20chromecast&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified
Thanks to the Google Developer Relations Team (esp. Leon Nicholls) for highlighting this.

DeepLink support for both iOS 8 and iOS 9

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.

How can a Developer Hand Over a Web Request to a Native iOS Application without displaying an error if the application is not installed?

So, we've all pretty much seen it. I tap a google plus link in Safari and it opens in the native Google Plus app. If the app is not installed, it takes me to the store to download it. It's a seamless transition.
As a developer, I would like this type of integration with my web application and native application. I've seen a way to call the native app using a custom url scheme, but this throws a nasty alert if the app isn't on the device.
I thought that the way around it might be creating a Safari extension, but that's not do-able with mobile safari.
How can I achieve this seamless transition effect?
This answer might help you to determine whether the app was installed or not from web app.
iPhone browser: Checking if iPhone app is installed from browser
If it's not installed you can continue redirecting to your web app instead of myapp://
The code from one of our web apps
var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
var messageContainer=$("#message");
if(!iOS)
{
messageContainer.html("Please open the link in your Apple mobile device")
}
else
{
setTimeout(function () {
messageContainer.html("Please install the app");}, 25);
window.location.href = "myapp://someInfo";
}

IOS Phonegap Functionality not working first time

I am opening one url in inapp browser. when i return from inappbrowser to my phonegap app. phonegap function like camera,gallery or even device ready is not working. but when i send app in background and resume it then all the functionality is wokring. :(
Where in Android all working fine but in ios not.
I have 3 html pages.from index.html i am opening the page in inappbrowser after i am comming to second.html in which i had use all functionality like camera,gallery.
I had used winload.location for redirection...
I had try lot.
Please Help me .... :(
I had this problem some time ago.
To me was related to the settings of the camera. I used following settings:
quality: 50, // or less for ios as in specifications,
destinationType: parent.window.Camera.DestinationType.FILE_URI, // ! Important
Regards

Blackberry WebWorks and the "Hardware Back Button"

i have problem with the "hardware back button" and Blackberry Webworks.
I'm using jquery mobile to create a phonegap application for Blackberry WebWorks (Smartphone version).
When i have a link in my page like:
everything works fine.
But when i use the WebWorks API to hook the "Hardware Back Button" like this
blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK,
function() {
history.back();
return false;
});
My app is just closed. (I tested on 9800 OS6 Simulator, and real device 9300 Curve 3G with OS6)
It's also strange when I modify the function to:
blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK,
function() {
alert('Debug');
return false;
});
then my app will not be closed (which should be correct)
So the problem is the calling "history.back()" inisde the onHardwareKey handler function.
Can anyone help me further?
Thanks
Adding this to config.xml worked for me:
<feature id="blackberry.system.event" version="1.0.0"/>

Resources