Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansemannn/ti.accountkit
DEPRECATED -- 🔐 Use the Facebook AccountKit iOS-SDK with Titanium Mobile.
https://github.com/hansemannn/ti.accountkit
account-kit facebook-sdk javascript native titanium
Last synced: about 2 months ago
JSON representation
DEPRECATED -- 🔐 Use the Facebook AccountKit iOS-SDK with Titanium Mobile.
- Host: GitHub
- URL: https://github.com/hansemannn/ti.accountkit
- Owner: hansemannn
- License: other
- Created: 2016-04-12T21:21:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-10T06:28:58.000Z (about 5 years ago)
- Last Synced: 2024-07-30T04:58:05.338Z (about 2 months ago)
- Topics: account-kit, facebook-sdk, javascript, native, titanium
- Language: Objective-C
- Homepage:
- Size: 62.8 MB
- Stars: 17
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ti.AccountKit
## ⚠️ The AccountKit framework has been deprecated by Facebook in September 9, 2019 and will stop workring on March 9, 2020.
### You can read more [here](https://developers.facebook.com/docs/accountkit/).Support for the Facebook AccountKit framework in Titanium Mobile to login using an email or phone number.
> Note: This is the iOS version of Ti.AccountKit. You might want to check [appwert/ti.accountkit](https://github.com/AppWerft/Ti.AccountKit) for the Android equivalent 🚀.
## Usage
Configure your tiapp.xml properly:
```xml
CFBundleURLTypes
CFBundleURLSchemes
ak{your-fb-app-id}
FacebookAppID
{your-fb-app-id}
AccountKitClientToken
{your-accountkit-client-token}
```
Check this example code on using both phone- and email-login:
```javascript
var win = Ti.UI.createWindow({
backgroundColor:'white'
});var accountkit = require('ti.accountkit');
// One of RESPONSE_TYPE_AUTHORIZATION_CODE or RESPONSE_TYPE_ACCESS_TOKEN
accountkit.initialize(accountkit.RESPONSE_TYPE_AUTHORIZATION_CODE);accountkit.addEventListener("login", function(e) {
Ti.API.warn("success: " + e.success);
Ti.API.warn(e);
});var btn1 = Ti.UI.createButton({
top: 40,
title: "Login with Phone"
});btn1.addEventListener("click", function() {
accountkit.loginWithPhone();// Optional: You can also pass a phone number and country-code to pre-fill the form
// accountkit.loginWithPhone('', 'DE');
});var btn2 = Ti.UI.createButton({
top: 80,
title: 'Login with E-Mail'
});btn2.addEventListener('click', function() {
accountkit.loginWithEmail();// Optional: You can also pass an email-address to pre-fill the form
// accountkit.loginWithEmail('[email protected]');// Use accountkit.logout() to logout and pass an optional callback to
// handle the asynchronous logout.
});win.add(btn1,btn2);
win.open();
```