distriqt / airnativeextensions

DEPRECATED: Original repository of the distriqt native extensions and is no longer maintained. Please see our site for the latest ANEs
https://airnativeextensions.com
2 stars 0 forks source link

FacebookAPI on IOS open Safari instead of a pop-up #202

Closed lisophorm closed 9 years ago

lisophorm commented 10 years ago

Hello,

I have the latest ANE and ios 7.1. Ipad. I tested your demo and went fine. Then the moment I added the CFBundleURLTypes now instead of a pop-up it opens Safari. Behaviour identical on Simulator and Device

Please advise

Bilicius commented 10 years ago

The facebook application are installed on the device? on my app if not it open on safari, if the facebook app are installed the popup show.

colouredFunk commented 10 years ago

I've been trying to fix this all week, today I released if you remove

CFBundleURLTypes
                                            <array>
                                            <dict>
                                                            <key>CFBundleURLSchemes</key>
                                                            <array>
                                                                            <string>fbXXXXXXXXXXX</string>
                                                            </array>
                                            </dict>
                                            </array>

It opens up the popbox regardless! Not sure if this is a bug?

koriner commented 10 years ago

If you have the native Facebook app installed, it should always open the authorisation prompt in the app, not in a web view or Safari.

Can you confirm that the Facebook app is installed and could you also post the code you're calling for the initialise and session creation, etc?

Thanks!

colouredFunk commented 10 years ago

Well I prefer the popup in webview as if it redirects to Safari and then the App restarts when returning for some annoying reason. I'm using the Starling Framework and doing this when the stage is activated and deactivated.

private function onStageActive(e:flash.events.Event):void { trace("onStageActive"); mStarling.start(); }

    /** Stage Deactivated */
    private function onStageDeactivate(e:flash.events.Event):void
    {
        mStarling.stop(true);
    }

I'm using the same code in the example to call the ANE

FacebookAPI.init( "DEV_KEY") FacebookAPI.service.addEventListener( FacebookAPIEvent.SESSION_OPENED, session_openedHandler ); FacebookAPI.service.addEventListener( FacebookAPIEvent.SESSION_CLOSED, session_closedHandler ); FacebookAPI.service.addEventListener( FacebookAPIEvent.SESSION_OPEN_DISABLED, session_openDisabledHandler ); FacebookAPI.service.addEventListener( FacebookAPIEvent.SESSION_OPEN_ERROR, session_openErrorHandler ); FacebookAPI.service.addEventListener( FacebookAPIEvent.GRAPH_REQUEST_COMPLETED, request_completeHandler, false, 0, true ); FacebookAPI.service.addEventListener( FacebookAPIEvent.GRAPH_REQUEST_ERROR, request_errorHandler, false, 0, true ); FacebookAPI.service.initialiseApp( "APP_ID" ); FacebookAPI.service.createSession( [ "public_profile, user_friends, publish_actions" ], true, true );

The Facebook SSO shows in webview regardless if the app is installed. That is, if I remove the following from the manifest file:

CFBundleURLTypes CFBundleURLSchemes fbXXXXXXXXXXX

If I aad it back in, the SSO either launches in the Facebook App or Safari (if not installed), but then restarts my App.. :s