0.1.0 • Published 10 years ago

react-native-account-kit v0.1.0

Weekly downloads
20
License
MIT
Repository
github
Last release
10 years ago

react-native-account-kit

React Native Account Kit for Android and iOS (soon)

Installation

npm install react-native-account-kit subscribable --save

Configure native projects

Android

iOS

How to use it

...

import React, {
    DeviceEventEmitter
} from 'react-native';

import AccountKit from 'react-native-account-kit';
var Subscribable = require('subscribable');

var AK = new AccountKit();
...
class MyProject extends Component {
    ...
    
    constructor(props, context) {
        super(props, context);


        AK.getCurrentAccessToken()
            .then(function (at) {
                console.log(at);
            })
            .fail(function (e) {
                console.log(e);
            });

        AK.getCurrentAccount()
            .then(function (account_info) {
                console.log(account_info);
            })
            .fail(function (e) {
                console.log(e);
            });
    }
       
    mixins = [Subscribable.Mixin];
    ...
}
  • To call the Login/Register View
    AK.loginWithPhone(); // Expects as Response Type a TOKEN by Default
    //AK.loginWithPhone(AK.RESPONSE_TYPE_CODE); // Set the response type as TOKEN if you need it
    
    //Now we need to set the listener for the successful login
    
    componentWillMount() {
        DeviceEventEmitter.addListener('AccountKitLogged', function (e:Event) {
            console.log(e); // Will have the token/code information
        });
    }

}
0.1.0

10 years ago

0.0.15

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.7

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago