+1
Answered

Twitter Authentication

Michael Mikkelsen 8 years ago updated 8 years ago 6
How do you use the new twitter authentication that's integrated with iOS and handle multiple twitter accounts?
If you add twitter into your App, our Engine will look for iOS integrated authentication first before it falls back on the standard manual solution we offered before. So really there is no auth that you need to write into the WIRE code, only the twitter datasource solutions.

http://content.rarewire.com/wordpress...

At this time, it will only auto select the twitter account at the top of the list within iOS settings. This will be enhanced in the future.
I'm trying to authenticate the login to twitter and display the screen_name of the user. My onquerycomplete alert is not fireing.


<wire>
<datasources>

<!-- datasources go here -->
<datasource name="twitter-login" source="https://api.twitter.com/1.1/account/verify_credentials.json" query="" onquerycomplete="ActionLogin" providertype="twitter"/>

</datasources>

<main>

<panel name="panel2" width="100%" height="100%" background="ffffff" cornerradius="10" datasource="twitter-login">
<text name="label" width="95%" height="30" alignment="left" align="center" valign="center" font="helvetica" size="50" color="#000000" text="@[param:screen_name]"/>
</panel>

</main>

<actions>

<!-- actions go here -->
<action name="ActionLogin">
<alert message="tried login "/>
</action>

</actions>
</wire>
Move your onquerycomplete attribute to the action tag


<action name="ActionLogin" datasource="twitter-login" datasourceevent="onquerycomplete">
<alert message="tried login "/>
</action>
I still can't get this to work. i don't know what I am doing wrong.
Well looking at this a little closer I notice you are attempting to use the param inside of a text tag. To pull a param from a datasource like you want, that has to be placed in an object tag. This would require that you create a class to drive the content of the object tag.

Does that make sense?

Also you twitter datasource prob needs Oauth info if you want to use the 1.1 API.
I found out the problem was the datasource query
Changed from query="" to query="/" and it works.