sencha android native app and facebook sdk - javascript

I have a problem with my sencha app, it uses facebook sdk javascript to log in, of course in the browser it works perfectly because facebook authorizes the domain name. but when i turn my app into a native android app, facebook rejects the app saying the given url is not allowed.
I have tried authorizing it as a native android app getting the key hash from the keystore I used, and putting in the facebook app with no success maybe i am missing something i would greatly appreciate any help in pointing me in the right direction

I solved it using the facebook connect plugin for phonegap and phonegap created by dave johnson
its in git hub
https://github.com/davejohnson/phonegap-plugin-facebook-connect/

You need to use the FB JavaScript library, not connect... Your best bet is to look at Jog With Friends in the ST2 examples directory to see how integration is handled

Related

loginPopup from #azure/msal-browser not working on Microsoft Teams desktop application

I'm creating a Tab for Microsoft Teams and I use loginPopup from the #azure/msal-browser to authenticate. In the web/browser application works just fine but I installed the tab in the desktop application and it doesn't work and the following error fires:
at EventEmitter.ipcRenderer.sendSync (<anonymous>:1840:18)
at Object.exports.invokeSync (<anonymous>:1814:41)
at Object.<anonymous> (<anonymous>:3360:22)
at Object.require.35../../common/atom-binding-setup (<anonymous>:3513:4)
at o (<anonymous>:2:273)
at r (<anonymous>:2:439)
at <anonymous>:2:468
at Function.PopupHandler.openSizedPopup (index.es.js:10451)
at PublicClientApplication.ClientApplication.acquireTokenPopup (index.es.js:11102)
at PublicClientApplication.loginPopup (index.es.js:12022)
Not sure if something about the msal library or something about the electron wrapper for the desktop app. Some directions on this will be appreciated.
for teams Tabs please do not roll your own authentication based on browsers, as your tab will need to work in browsers , but also Windows / Mac OS / linux / iOS and Android.
Instead take a looks at the documentation for Teams Tab Authentication or,
even better AAD Single Sign On
https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab
https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/auth-aad-sso
LoginPopup won't work because Teams surfaces it's own authentication popup to provide the ability to integrate MSAL or similar, so you end up needed to do LoginRedirect, within the popup, which you launch via microsoftTeams.authentication.authenticate. This is to handle desktop, web, and mobile device scenarios properly.
Of course, the best place to start is with the docs, like here and here and here, but unfortunately these mostly still refer to ADAL, which is being deprecated, instead of MSAL. So, as an alternative, I'd suggest looking at this recent PnP sample for MSAL authentication. I'm currently working on an SSO sample for this PnP repo - it's still in progress, and especially the docs are not complete, but you can see a working dotnet sample here.

How To Interface Android/iOS App With Cordova Hybrid Application

I need some help in order to interface a native Android/iOS app with my Cordova Hybrid Application and send messages from each to other.
Can I use in total freedom cordova.exec command to send messages to the native application?
Must I create a plugin to embed it?
May you suggest me an example that fits with Cordova 5.0 version?
How can I wrap cordova.exec into an Angular service?
Cordova exec is not a function to execute anything on your device.
It's a function to call native code from the javascript but the function you call has to be either from the cordova framework, or from a plugin.
If you want to communicate between apps, you will have to either make your plugin using native code or maybe you can find a plugin already doing it.
For android you can communicate between apps using intents, for ios I have no idea.
You can have a look at the app launcher plugin, it covers the launching an app from an other app part.
For the passing parameters and receiving result part, on android it's easy, you just have to add parameters to the intent.
For IOS, you can read this document.

Access to my Facebook application from phonegap

when I register my Facebook application I asked for Website URL. That means that only users from that URL can be access to Facebook API. But I don't need it.
I'm made a mobile application by phonegap, I used ionic (HTML5 mobile framework).
I made an initialize to Facebook SDK in my javascript files, and tried to access to the api. Well it didn't work becuase the hostname on mobile application is '' (none, nothing, empty string), there is no hostname/URL parameter on mobile application.
When I tried it on my computer it worked when I put in Facebook application settings this website URL: http://localhost/, and it's worked becuase i really was on localhost.
How should I fix it, so I could access to my application from every URL and not only the URL I asked in the application settings?
Sample of my javascript code: (Written with angular.js)
$scope.loginFB = function() {
Facebook.login(function(loginResponse) {
if(loginResponse.status == 'connected') {
$rootScope.$storage.local.userLoggedIn = true;
Facebook.api('/me', function(facebookUser) {
$rootScope.$storage.local.currentUser = facebookUser;
});
}
});
};
take a look to sociogram sample on github
, a sample application demonstrating how to integrate with Facebook in your Angular/Ionic apps
If you have a mobile application, you should integrate with facebook mobile sdk for android and ios.
See:
https://developers.facebook.com/docs/ios/
https://developers.facebook.com/docs/android
There are several cordova plugins that can help you with such integration (I am the author of one by the way). You can search for these plugins at http://plugreg.com/search?q=facebook
I have successfully used Facebook connect plugin and for ionic framework you can also try ngCordova Facebook

CRITICAL issue with iOS, CocoonJS and Facebook

I've just published in the Apple's Appstore a CocoonJS powered Javascript game that integrates some Facebook functions. After creating my app to Facebook, I spent weeks testing it in the CocoonJS Launcher, and I found the following:
In iOS, the user should grant permissions to apps that tries to access Facebook through the phone's Settings -> Facebook, where a list of apps appear.
I did so with the CocoonJS Launcher and then Facebook started working as expected. However, the final app (generated through the Cloud Compiler) has just been published in the store and, after trying to access Facebook from within the app, the app says that the user should grant permission from Facebook's settings (as I did with the Launcher), but it doesn't appear at the phone's Settings -> Facebook (that is, the list of apps that use Facebook and where it appeared the Launcher).
I've created my app in Facebook, retrieved its ID number, put it in the CocoonJS Cloud Compiler (both for Apple and Android) and, of course, called the "init" function inside the game with the corresponding Facebook app code... Even though it worked with the Launcher, it doesn't work with the app, and now my app is alive and no Facebook integration can be done (which is a real mess, because almost every game function uses it now)...
How could I solve it? What can be happening? Might it have something to do with the Cloud Compiler, or maybe it's related to the JS code?
Thanks in advance for your time and effort! :)
As states in help center, do some testing first with a custom launcher:
http://support.ludei.com/hc/en-us/articles/200767268-Custom-Launcher
The CocoonJS launcher you download from the store has the configuration string of Ludei:
http://support.ludei.com/hc/en-us/articles/200924496-Social
The problem may not have been in the submission, but in the development of the application.
In case you feel it's a bug, please fill a bug report with the following template in their help center.
The template guide:
http://support.ludei.com/hc/en-us/articles/203459717-How-to-report-a-CocoonJS-bug
The forum to post the issue (troubleshooting section):
http://support.ludei.com/hc/communities/public/topics/200011348-Problems-Troubleshooting

detect Android app is installed or not in device using javascript or jquery

I build a webapp and I have social links in my webapp.
I am facing an issue regarding this. If I am having facebook installed in my device then on click of the share link it should open the native app instead of opening in browser.
And incase if I doesnt have any native app installed then it should automatically redirect to browser.
Here it is the code what I have tried:
Javascript:
if(isAndroid){
fb://profile//www.facebook.com/sharer/sharer.php // to open in native browser
http://wwww.facebook.com // to open in web browser.
}
How do I handle this urls...
Please help me out.
This is not possible, for privacy reasons.
See This answer
You can make Hybrid Application.
What you just need to do is ADD WEB INTERFACE which will make call to native source code through javascript and also get return value.
So you can write native function which will return if application is installed. Once you set this interface you can use it further for open that app and passing intent and all that.
You can do it easily. Start Here:
https://developer.android.com/guide/webapps/webview.html

Categories