Phonegap App : External URL don't open in InApp Browser of IOS - iphone

External URLs don't open in the system's browser in my PhoneGap IOS application. I'm using PhoneGap Build 2.7.0.
Javascript:
window.open(myURL, '_blank', 'location=yes');
Config.xml
<plugins>
<plugin name="InAppBrowser" value="CDVInAppBrowser" />
</plugins>
<access origin="*" />
How to solve this? when i using the url "www.google.com" it works fine but when i used required url for my app it did not worked even that url works fine in browser.

Javascript:
myURL = encodeURI(myURL);
window.open(myURL, '_blank', 'location=yes');
Using of encodeURI method fix the above issue

Take reference from this link.
I have used this plugin for my IOS application development way back. It works like a charm.
Also, it is easy to integrate.
Hope it helps !

Related

How to create Android app links using branch.io in Ionic 2/3 app?

I'm having a bit of difficulty understanding the implementation of some of the branch concepts for the Ionic platform Wrapper SDK .
I've generated short URLs using the SDK, but it seems to get redirected in the browser before the app is launched. Link -> Browser -> App handoff.
How do I avoid this redirection? I've enabled Android app link, added SHA 256 of certs and added all configs in config.xml as per SDK docs.
Is it possible to generate long links as using the "/a/ and the Branch Key" as in https://bnc.lt/a/key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F
Something like branchcordova://a/key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F
Looks like a configuration issue. Have you added your Link Domain on the config.xml file? You can find your Link Domain on the Link Settings page.
<!-- sample config.xml -->
<widget id="com.eneff.branch.cordovatestbed"
version="0.0.1" xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
<!-- Branch -->
<plugin name="branch-cordova-sdk" spec="^2.5.0" />
<branch-config>
<branch-key value="<YOUR LIVE KEY>" />
<uri-scheme value="<YOUR URI SCHEME>" />
<link-domain value="<YOUR LINK DOMAIN>" />
<ios-team-release value="<YOUR TEAM ID>" />
</branch-config>
Long links can only be generated using your Link Domain.
Something like branchcordova://a/key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F is incorrect.
Someting like https://example.app.link/fzmLEhobLD?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F is correct.
You should use https://link.example.com if you have a custom link domain configured.
More info on Long Links- https://docs.branch.io/pages/links/integrate/#long-links
If we use the Android app link (URI scheme), then the app would be open directly. But, it would be detected as a non-branch link and we might not get any analytics data or branch.io related features.
The redirection of short and long URLs seems to depend on the app which is opening the link. Some apps like Hangout app do the redirect thing.
If we are to open a branch link from inside our app, we could do the following to somehow skip the redirection.
const longLink = https://bnc.lt/a/key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt?foo=bar&baz=456;
window.open(longLink, '_system');

Ionic app not makes http requests

I developed an app with Ionic v1 and tested with "ionic serve" and "ionic run android" and works fine. It makes all $http requests to an external API (that allows CORS) and I recive the data well.
The probleme comes when I try to test the app in real mode. I added the app to Ionic view to test in Android mobile device and I see that the requests to the API are not performed (because I not see any data printed in tha app).
For what reasons can be? I need to perform extra configs in my API server? I need to perform some special configs to Ionic app?
PD: I installed cordova withelist plugin and added this lines to config.xml file:
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="*" />
You verify if Cordova CLI has generated these Android permissions entries in your AndroidManifest.xml?
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
I hope that helps.
Greetings.

How to make opentok working in ionic for ios?

I installed Cordova Plugin for OpenTok iOS in Ionic app
Using this
cordova plugin add https://github.com/songz/cordova-plugin-opentok/
When i refer it using this
< script type="text/javascript" charset="utf-8"
src="opentok.js">
in Index.html File
I get not found (404)
This is normal behavior, because cordoba serves the plugin on the mobile device. When you debug on your web, cordoba is inactive, so you need to provide these dependencies yourself.

sencha touch debug emulator failures

I have a sencha touch example application which works fine on browser (using sencha web start) and iOS and Android simulators (built with phonegap and launched using sencha app build -run native).
I made few changes and was testing in browser alone, unfortunately. When I finally launched the app in simulators, app does not launch. I do not see the main view corresponding screen. It shows a blank screen on app launch. Application works fine in simulator browser as well. App based launch alone fails.
How do I troubleshoot the app failures on simulator? Are there any logs I need to look at? Have no clue.
I have Sencha Touch 2.3.1 and Sencha Cmd v4.0.4.84 on ubuntu OS.
No IDE as of now.
UPDATE
Was able to narrow it down to the store problem. I am trying to launch the First App in sencha docs. Store is making ajax call to googleapis. Not sure if this is causing the problem. I changed this to use local store and app launch worked fine. No idea why app is not able to get the data from googleapis. Simulator browser is able to get the data but just not the app.
As mentioned in the update, app tried to access google api url to get the json data. config.xml in project's root folder prevented access to external domains. As a result app failed to render the view. Fixing it as mentioned in Error: Whitelist rejection in Phonegap to allow required domains worked.
<!--
Define access to external domains.
<access /> - a blank access tag denies access to all external resources.
<access origin="*" /> - a wildcard access tag allows access to all external resource.
Otherwise, you can specify specific domains:
-->
<access origin="http://127.0.0.1*"/> <!-- allow local pages -->
Change <access origin= to <access origin="*"/> to allow all domains or use your specific domains.

Retrieve Blackberry OS in Blackberrywebworks using javascript

How to retrieve Blackberry OS version in Blackberrywebworks using javascript?
Just use blackberry.system.softwareVersion and don't forget to add <feature id="blackberry.system" /> to your config.xml
You can find full docs here
https://developer.blackberry.com/html5/apis/blackberry.system.html#.softwareVersion