Opening facebook page and app store using ionic 3 in iOS - ionic-framework

I wanna open my facebook page link using the ionic: It's working in Android using:
window.open('fb://page/620967164688741', '_system')
and through some tutorials I came to know that in order to open Facebook page, use the:
window.open('fb://profile/620967164688741', '_system')
But even after doing that, I'm unable to open.
And same goes with open the store, on Android it's working fine but again issue on iOS. Below is the code:
let promise = this.market.open('com.teach9.teach9');
Can someone correct me where I'm making mistake?

How about you check this plugin out for iOS - "inAppBrowser" at "https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/"?
P.S. In iOS you should be able to open any webpage inside the inAppBrowser, Make sure that the target is set as "_blank" instead of "_system".

Related

Is there a way to use the mailto: or message: scheme in a PWA in iOS 12.2?

I've built a PWA using Ionic 4 that had a "Contact" Button with a simple href using the 'mailto:' scheme.
Contact
This used to open the native Mail app in iOS 12.1 when starting the PWA from homescreen. Since I updated to iOS 12.2 it just opens the PWA internal Safari with a message that Safari can't open links starting with 'mailto:'
I have tried using other URI schemes like 'instagram:' or 'message:' but they all lead to the same problem. The only one that I have found to still be functional when I start my PWA from homescreen is the 'tel:' scheme.
Has anyone else encountered this problem and has any idea how to still open URI schemes other than tel: from a PWA that has been opened from homescreen?
I managed to get it working using the below click function.
Tested on both Android and iOS PWA.
()=>{
window.location.href = "mailto:support#example.com?subject=" + emailSubject + "&body=" + emailBody
return
}
I have a PWA which is installed on iOS 12.2, my link uses target="_blank" and it works.
Did you try this ?
Have a nice day,

How do I open any app from my web browser (Chrome) in Android, automatically?

I am struggling a little bit. I have a common url like www.domain.com/test.html
and i want Android users to get my app open if "test" is included, otherwise if they don't have the app their should be directed to the play store. I got everything implemented and it works with mozilla browser. But using chrome on Android it should be forbidden to automatically open the app if it is available!?. Now if the user enters www.domain.com/test.html and i recognize he is using Android and Chrome i tried the intent stuff in a script in a redirected www.domain.com/android_chrome.html:
<script> window.open("intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;S.browser_fallback_url=http%3A%2F%2Fzxing.org;end","_self")
</script>
But the App won't open automatically. If i use a regular Link:
Take a QR code
it works. But i want to let it open automatically!
Google restricted starting intents from javascript apps, that's why it isn't working. Security reasons I guess. You should just display nice big link to let user switch to your app instead of website - or let him continue if he doesn't want to launch the app.
Forcing users into using app is bad, IMO. Splash screen suggesting to use it is okay, but don't push it.

Not able to Close blackberry 7 browser from my code

Thanks! Hello everyone! I am making a BlackBerry 7 mobile native application. On click of button from my native application. It will be open a URL in a separate browser. So, I want to close the opened browser. The URL it is opening. This URL is separate domain, but this is my page, in this page i have tried following code. But, it is not working -
blackberry.app.exit();
window.close();
System.exit();
I have tried to open the URL in my native application using iframe. But, here always taking me splash screen instead of loading URL.
Are you using WebWorks or Cordova (nee PhoneGap) ? One solution is to use Cordova 2.9 (the last version to support BBOS) and the InAppBrowser API.

How to add facebook-ios-sdk in app for login and fetch user data

I want to integrate the facebook login dialog in my app. For that i have checked the facebook developer page to integrate it.
1 - Downloaded facebook sdk package and installed it
2 - added facebook.framework and FBUserSettingsViewResources.bundle in my app
3 - and use its SessionLoginSample
Its running and user can do login using facebook but its open in safary instead of that i want to open it in dialog box.
Answer in here says that do change in facebook.m file but my project does not have it. for that i have downloaded facebook-ios-sdk project from the GITHub and in that project from src folder i have copied all file in my project. Its non arc so added flag fno-objc-arc.
But facebook.m file does not contain that code which answer suggested to change. And also i have implemented graph GraphApiSample but it display error in FBLoginView.
So plz help on this topic any code or tutorial will be highly appreciable.
If you want to open the login page within your app you have to use the FBGraphAPI .
If you want to force the web dialog, you need to specify the login behavior.
If you look in FBSession, there are many methods to open a Session, many of which will take an FBSessionLoginBehavior parameter. If you pass in FBSessionLoginBehaviorForcingWebView for the login behavior, it will force the web view dialog.

Phonegap - Open Links in Browser except embedded Videos

I'm Developing an App using Phonegap, target Devices are Android or iOS driven. My Problem is, that on the iPhone I can only set the "open all whitelist urls in webview" parameter to true or false. So that is the Problem:
Expected Result:
- All links (like www.google.com, www.stackoverflow.com) should open in the Browser
- An embedded iFrame with a Youtube Video should open in the Webview
Result with "OpenAllWhitelistUrlsInWebview" Set to true
- All links and iFrames will open in the Webview
Result with "OpenAllWhitelistUrlsInWebview" Set to false
- No links and iFrames will open in the Webview
How can i specify which links should open in the Browser and which shouldnt? When i remove an url from the whitelist the link won't open at all and also setting target="_blank" wont work properly. Trying it with window.open didn't work either.
Thank you very much for every idea.
Implemented this over the weekend, and it's working great:
http://www.rigelgroupllc.com/blog/2012/05/22/opening-links-in-phonegap-apps-in-mobile-safari/
This will allow you to set up your plist for the youtube video, while using the above method to open specified links in the external browser.
I'm not sure what/if you need to do anything in Android.