marpies / airtwitter-ane Goto Github PK
View Code? Open in Web Editor NEWTwitter extension for Adobe AIR (iOS & Android)
License: Apache License 2.0
Twitter extension for Adobe AIR (iOS & Android)
License: Apache License 2.0
after the authorization interface, I call back to my app directly. I don't see the web page with PIN. Can you tell me my progress is right???
and when i login ,the log is "login cancelled","Returned to app manually after login attempt, thus login cancelled".
my code:
public function clickTwitterLoginIOSBtn():void {
if( AIRTwitter.init( CONSUMER_KEY, CONSUMER_SERCRET, URL_SCHEME, onCredentialsChecked, true ) ) {
trace( "ANE initialized" );
} else {
trace( "ANE failed to init" );
}
}
private function onCredentialsChecked( credentialsValid:Boolean, credentialsMissing:Boolean ):void {
if( credentialsValid ) {
trace( "User credentials are valid - no need to login again" );
/* You can use the rest of the AIRTwitter's API */
return;
} else if( credentialsMissing ) {
trace( "User credentials are missing" );
AIRTwitter.login(onTwitterLogin, true);
} else {
trace( "User credentials are invalid" );
}
}
private function onTwitterLogin( errorMessage:String, wasCancelled:Boolean ):void {
if( errorMessage ) {
trace( "Login error: " + errorMessage );
} else if( wasCancelled ) {
trace( "Login cancelled:" + wasCancelled );
} else {
trace( "Successfully logged in" );
const user:AIRTwitterUser = AIRTwitter.getLoggedInUser( onLoggedInUserRetrieved );
if( user ) {
// cached value returned
}
}
}
// if cached value is not returned callback will be triggered
private function onLoggedInUserRetrieved(user:AIRTwitterUser, errorMessage:String):void {
trace( user.name );
}
The callback for AIRTwitter.init gives me: User credentials result: missing.
I'm testing on my Android phone. I've logged out of my Twitter account in the native Twitter app, and logged back in, twice. Still getting the same thing. Any suggestions on what I should look at next?
Attached is my app-xml.
RPTest-app.txt
Now I can call back to my app ,but it always show the log of "login cancelled true"and"Returned to app manually after login attempt, thus login cancelled".
I want to login my app through twitter, how can I success to login ????and how can I get the ID of user who is login???Can you check my code ,where is the error caused the login cancelled????
My log is:
ANE initialized
[AIRTwitter] User credentials result: missing
User credentials are missing
[AIRTwitter] onInvoke standard
[AIRTwitter] onInvoke standard
[AIRTwitter] Returned to app manually after login attempt, thus login cancelled
Login cancelled:true
[AIRTwitter] onInvoke standard
[AIRTwitter] onInvoke openUrl
my code is
public function clickTwitterLoginIOSBtn():void {
trace("clickTwitterLoginIOSBtn");
if( AIRTwitter.init( CONSUMER_KEY, CONSUMER_SERCRET, URL_SCHEME, onCredentialsChecked, true ) ) {
trace( "ANE initialized" );
} else {
trace( "ANE failed to init" );
}
}
private function onCredentialsChecked( credentialsValid:Boolean, credentialsMissing:Boolean ):void {
if( credentialsValid ) {
trace( "User credentials are valid - no need to login again" );
/* You can use the rest of the AIRTwitter's API */
return;
} else if( credentialsMissing ) {
trace( "User credentials are missing" );
AIRTwitter.login(onTwitterLogin);
} else {
trace( "User credentials are invalid" );
}
}
private function onTwitterLogin( errorMessage:String, wasCancelled:Boolean ):void {
if( errorMessage ) {
trace( "Login error: " + errorMessage );
} else if( wasCancelled ) {
trace( "Login cancelled:" + wasCancelled );
} else {
trace( "Successfully logged in" );
AIRTwitter.getLoggedInUser(onLoggedInUserRetrieved );
}
}
// if cached value is not returned callback will be triggered
private function onLoggedInUserRetrieved(user:AIRTwitterUser, errorMessage:String):void {
userID = user.id;
}
Please help me!!!!!
Hello there!
Thank you for your extension! But, when I run the init function on IOS, i get "User credentials are missing" message. How can fix that, Where is my fault?
AIRTwitter.init( "3f9Pdz5VuAeJ5DFxUv68vHDIwsa", "IIjogkaSzBzKEmn7b2pAewEowvcHdDASD5452as8sDAy24aAm", "TwitterTestApp", onCredentialsChecked, true )
(These aren't my real key and secret)
Thank you!
Thank you for the effort and time you put in AIRTwitter-ANE
Is it possible to login with tokens from dev.twitter.com ?
https://dev.twitter.com/oauth/overview/application-owner-access-tokens
I want to updatestatus of an existing twitter account not a user account
I see that accessToken and accessTokenSecret are read only properties
sorry if my question looks confusing I'm new to Oauth and twitter API
if player don't have a in-system twitter account, i use this to login, and logged in successfully, but when switch back to the app, there is no callback.
please take a look, thanks.
Hi,
first of all, thanks for this and your hard work! 👏🏻
I'm working on ios/android app built using starling & feathers. I keep getting "User credentials are missing" after the browser redirects me back to the app after the successful authorization in a browser.
Even though I call the AIRTwitter.init
as soon as I can, I keep getting this error. I followed the documentation, check all issues but still does not understand why this is happening. Seems to me like the credentials information are not passed from browser (~ url scheme) to the app correctly.
Any thoughts?
Thanks.
Thank you for your code .I have be successful to use the ane to login with twitter.But now it doesn't work.
when I click the button of "login", I can come back to my app successfully .But the ane will tell me
"Returned to app manually after login attempt, thus login cancelled". at first. Then tell me "[Airtwitter]login successful".
So Can you tell me the reason??
Can I give my suggestion to you ? Can you make the Event funcion of "onStatus" to be public.and When it determines." login success". Can you dispatch a event of the success.Then I can use the function of "addEventListener" to distinguish. Please Help me ??
hello:
I have a question in the ane, in the function of init , I don't know what is the URL SCHEME, Because my app don't have a url scheme, Can you help me??
@marpies
public function clickTwitterLoginIOSBtn():void {
trace("clickTwitterLoginIOSBtn");
if( AIRTwitter.init( CONSUMER_KEY, CONSUMER_SERCRET,URL_SCHEME,onCredentialsChecked, true ) ) {
AIRTwitter.login(onTwitterLogin);
}
I get on the authorization in the Safari, Can I make the progress of authorization in a separate page?
I want to complete the all progress in my app, Does the ane have the function???
Hello,I find a error of the ane .My twitter ID have 18 digits like "111111111111111111". And I use my twitter account to login to my app. and I login successfully. But When I want to get the twitter ID.
The result is "111111111111111100". the last two digits of the twitter ID will be "00". and the last third digit will rounding. but if the digit of twitter ID less than 16, the twitter ID I got will be correct
example:
Real Twitter ID : 111111111111111111 Obtained Twitter ID: 111111111111111100
Real Twitter ID : 111111111111111155 Obtained Twitter ID: 111111111111111200
Can you fix the error? Wish your answer
Hello,
i'm trying to add two ANE(AIRTwitter-ANE and /AIRFacebook-ANE) in the same application.
Error occurred while packaging the application:
duplicate symbol OBJC_CLASS$_FREObjectUtils in: ... (full message
ErrorOccurredWhilePackagingTheApplication.txt
I found : https://forums.adobe.com/thread/2055508
Can you rename classe ? This is simle solution for now(or if you give other solution ? ).
Thanks. Serguei. Glowbl.
Thank you for you suggestion, Now I can log the message of"[AIRTwitter] Login success". But I also can't get the message of "Successfully logged in" from the call back of login function, But I want to get the user ID of login user. How can I monitor the success of login ?? and Which function I should use to get the user ID??Would you give the simple example to monitor the success of login and get the user's ID???
my step is :
when I click the button of "login in twitter", then it open the Safari to Authorization, and I click "agree" , then it will find my app, and it will be back to the login page of my app automatically. Why it will show that log of "Returned to app manually after login attempt, thus login cancelled".
my log like this:
and my code is like that, but I can't get the user's ID,because the function of call back always "Login cancelled true".
Can you give some suggestion??
Hi @marpies,
I'm very happy seeing this ANE, it's really good to try on my apps. Well, if you dont mind, would u provide sample code?
According, the sample you gave, seems like u dont give us example how to get user info.
Thank u for the attention.
Regards
I'm trying to integrate your ANE – great ANE by the way – and get a build error:
Error occurred while packaging the application:
aapt tool failed:Warning: AndroidManifest.xml already defines versionCode (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionName (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
C:\Users\danfl\AppData\Local\Temp\7020cf25-1c31-4481-b943-8325017eeeab\AndroidManifest.xml:107: Tag missing required attribute name.
Here's my - app.xml code:
<activity
android:name="com.marpies.ane.twitter.LoginActivity"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"/>
<activity>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:host="twitter_access_tokens" android:scheme="com.runpee"/>
</intent-filter>
</activity>
</application>
</manifest>
BTW, I'm only using this ANE to send simple tweets ( AIRTwitter.updateStatus ). Are there any unnecessary tags here?
Thanks,
Dan
way 1:
//bmd
var bitmap:BitmapData = new myBitmapData();//some bmd in library
//encode
var bytes:ByteArray = bitmap.encode(bitmap.rect, new PNGEncoderOptions());
var file:File = File.applicationStorageDirectory.resolvePath("tempTwitter.png");
var st:FileStream = new FileStream(); st.open(file, FileMode.WRITE); st.writeBytes(bytes); st.close();
//share
AIRTwitter.updateStatus("share text", onTwiiterShared, null, [file.nativePath]);
this will not work because the callback onTwiiterShared returns a errorMessage : Error creating data for upload.
way 2:
//bmd
var bitmap:BitmapData = new myBitmapData();//some bmd in library
//share
AIRTwitter.updateStatus("share text", onTwiiterShared, null, [bitmap]);
this will lead the app to crash.
so as a whole i can't do that in neither way.
according to the doc: media:Array (default = null) — List of media files (String - URLs to local and remote images, BitmapData) - max. 4.
i can't get the correct way to use this Parameter: media, please help, thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.