Giter Site home page Giter Site logo

manjav / air-extension-gplus Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 3.26 MB

Adobe AIR native extension (ANE) for Android to connect Google+

License: MIT License

ActionScript 42.21% Java 56.86% Batchfile 0.94%
adobe-air adobe-native-extention google-plus actionscript android adobe-flex adobe-flash ane

air-extension-gplus's Introduction

About

Adobe AIR native extension (ANE) for Android to connect to Google+ .

It uses Google Plus API (com.google.android.gms.common.api.GoogleApiClient).
Supported functionality:

  • user info (Google+ ID, name, Google+ url, email, photo url, birthdate, gender)
  • friends info (Google+ ID, name, Google+ url, photo url, gender)

Docs

Please, read docs and try ANE before asking any questions.
http://www.androidhive.info/2014/02/android-login-with-google-plus-account-1
http://help.adobe.com/en_US/air/extensions/index.html
https://developers.google.com/identity/sign-in/android/start

Installation

Extension ID: com.gerantech.extensions.gplus
Add "gplus-extension.ane" from package folder to ane folder in your AIR project.
Add the following lines to your AIR Aplication-app.xml file inside <manifestAdditions> section:

<application android:enabled="true">
<meta-data android:name="com.google.android.gms.version" android:value="4452000" />
<activity android:name="com.gerantech.extensions.gplus.GPConnector" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
</application>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Examples

import com.gerantech.extensions.gplus.GPlusExtension;
import com.gerantech.extensions.gplus.events.GPlusEvent;
import com.gerantech.extensions.gplus.models.Result;

...

private var extension:GPlusExtension;
...

// initialization of Google Plus API
extension = GPlusExtension.instance;
extension.addEventListener(GPlusEvent.GPLUS_RESULT , extension_eventsHandler);

...

// call this methods step by step after you dont received any error or failure message
extension.init();
...
extension.login();
...
extension.logout();
...
extension.revokeAccess();

protected function extension_eventsHandler(event:GPlusEvent):void
{
	switch(event.result.response)
	{
		case Result.CONNECTION_FAILED:
		case Result.LOGIN_CANCELED:
		case Result.LOGIN_FAILED:
		case Result.NETWORK_ERROR:
		case Result.PERSON_NULL:
		case Result.REVOKE_ACCESS:
			trace(event.result.response + "  " + event.result.success + "  " + event.result.message);
			break;
		case Result.PERSON_INFORMATION:
			trace(event.result.person.name + " " + event.result.person.email + " " + event.result.person.friends.length);
			break;
		
	}
	//trace(event.type, event.data);
}

Misc

ANE is build for AIR 18.0+, in order to rebuild for another version do the following:

  • edit "air\extension.xml" and change 18 in very first line to any X.x you need;
  • edit "package.bat" and in the very last line change path from AIR 18.0 SDK to any AIR X.x SDK you need;
  • execute "package.bat" to repack the ANE.

Thanks to

ravitamada

air-extension-gplus's People

Contributors

manjav avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.