npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nativescript-facebook-account-kit

v1.3.1

Published

Facebook account kit plugin for {N}.

Downloads

19

Readme

Facebook Account Kit plugin for NativeScript (Unofficial)

This plugin is a wrapper in {N} around the native facebook's Account Kit's iOS and Android plugins.

Refer to facebook's docs to understand how Account Kit works and how to set it up on Facebook's developer portal.

Installation

tns plugin add nativescript-facebook-account-kit

iOS

On iOS, Add the following to your Info.plist found under /app/App_Resources/iOS somewhere inside <dict />

    <key>FacebookAppID</key>
	<string><!--Your app id from developer portal--></string>
	<key>AccountKitClientToken</key>
	<string><!--Client token from dev portal--></string>
	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>ak<!--Your app id from developer portal--></string>
			</array>
		</dict>
	</array>

Android

On Android, Add the following to AndroidManifest.xml inside the <application> tag.

	<meta-data android:name="com.facebook.accountkit.ApplicationName"
				android:value="@string/app_name" />
	<meta-data android:name="com.facebook.sdk.ApplicationId"
			android:value="@string/FACEBOOK_APP_ID" />
	<meta-data android:name="com.facebook.accountkit.ClientToken"
			android:value="@string/ACCOUNT_KIT_CLIENT_TOKEN" />

	<activity android:name="com.facebook.accountkit.ui.AccountKitActivity" >
		<intent-filter>
				<action android:name="android.intent.action.VIEW" />
			<category android:name="android.intent.category.DEFAULT" />
			<category android:name="android.intent.category.BROWSABLE" />
			<data android:scheme="ak<Your Facebook app id>" />
		</intent-filter>
	</activity>
    

Add the following as your strings.xml file under app/App_Resources/Android/src/main/res/values/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <string name="app_name">Your App Name </string>
    <string name="title_activity_kimera">Your App name</string>
    <string name="FACEBOOK_APP_ID">FACEBOOK_APP_ID</string>
    <string name="ACCOUNT_KIT_CLIENT_TOKEN">ACCOUNT_KIT_CLIENT_TOKEM</string>
</resources>

Account Kit and Google Play Services Version

The plugin will default to this version of the Android play-services-auth SDK and account-kit-sdk SDK. If you need to change the versions (to for instance the latest version), you can add project ext properties googlePlayServicesVersion and accountKitVersion to app/App_Resources/Android/app.gradle:

project.ext {
   googlePlayServicesVersion = "+"
   accountKitVersion = "+"
}

Usage

Initialize the plugin with the response type you seek either AuthorizationCode or AccessToken

import { FacebookAccountKit, AccountKitResponseType } from 'nativescript-facebook-account-kit';
const facebookAccountKit = new FacebookAccountKit(AccountKitResponseType.AuthorizationCode);
import { Color } from "tns-core-modules/color";

const options : AccountKitOptions = {
      prefillPhoneNumber : "9XXXX12345", 
      prefillCountryCode : "91",
      defaultCountryCode : "IN",
      whitelistedCountryCodes : ["IN"],
      blacklistedCountryCodes : [],
      enableGetACall : true,
      presentAnimated : false,
	  enableSendToFacebook : true,
	  primaryColor : new Color("orange")
    };
    this.facebookAccountKit.loginWithPhoneNumber(options).then(authCode => {
      this.authCode = authCode;
      console.log(authCode);
    }, error => {
      this.authCode = error.message;
      console.error(error);
    });

API

| Method | Description | Return type | | --- | --- | --- | | loginWithPhoneNumber | Use account kit login flow with lot of options. | A promise that resolves to either authorization code or access token. | | loginWithEmail | Use account kit email flow. | A promise that resolves to either authorization code or access token. |

License

Apache License Version 2.0, January 2004