oauth-io / oauth-phonegap

OAuth.io plugin for Apache Cordova/PhoneGap
195 stars 69 forks source link

[Question] Ionic framework compatibility? #21

Closed RubenCordeiro closed 10 years ago

RubenCordeiro commented 10 years ago

Hi, I'm using the ionic framework in order to build a single page application. However, I can't seem to use this library with my project. There's a discussion thread with users that have the same issue: http://forum.ionicframework.com/t/oauth-io-plugin/3542

I've added the cordova inAppBrowser plugin. The popup works in the browser, however, it doesn't work when I deploy it via cordova. The popup isn't opened and the callback isn't called.

I've installed the inappbrowser plugin as seen in the config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionicframework.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Payback</name>
    <description>
        The place where you get paidback.
    </description>
    <author email="hi@payback" href="http://example.com/payback">
      Payback Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />

    <!-- Don't store local date in an iCloud backup. Turn this to "cloud" to enable storage 
         to be sent to iCloud. Note: enabling this could result in Apple rejecting your app.
    -->
    <preference name="BackupWebStorage" value="none" />

    <gap:plugin name="org.apache.cordova.inappbrowser" />
    <feature name="InAppBrowser">
        <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" />
    </feature>
    <feature name="InAppBrowser">
        <param name="ios-package" value="CDVInAppBrowser" />
    </feature>
</widget>

I'm a bit lost regarding this issue. Any thoughts?

william26 commented 10 years ago

The problem seems to come from an error in our plugin.xml. We are currently working on version 0.2.0 which contains a fix for this. We tested 0.2.0 with ionic by adding the plugin thanks to the cordova command, and everything seems to work fine now.

Though it is still under development at this hour, you can already check out the code by taking a look at our develop branch. Version 0.2.0 will also bring new features like the cache or the .me() request method.

You can also test this version in your project by calling the following command :

$ cordova plugin add https://github.com/oauth-io/oauth-phonegap.git\#develop

We will probably release the 0.2.0 in the next few days, so please stay tuned.

I hope this helps :)

Edit (06-04-2014) : We released version 0.2.0 today.

RubenCordeiro commented 10 years ago

Yeah, it's working. Thanks for the input.