Open command line :
git clone https://github.com/habiba1997/Nativescript-Angular-Projects.git
For logging in with your Facebook account, you should have a Facebook developer account. If you don't have one yet, you can get one here .
- Go to https://developers.facebook.com/apps and create a new app
- If you see the Product Setup page, select Facebook login
- Make sure to turn ON the option "Embedded Browser OAuth Login" and Click Save
- Copy the App ID and the App Secret from the Dashboard page to bootstrap your app. These will be the ClientID and ClientSecret respectively.
- Open Facebook project folder in your IDE
- Open command line and write "npm install" to install packages in package.json file
- Open src >> app >> authProviderHelper.ts
- Enter Your ClientID and ClientSecret in configureOAuthProviderFacebook Function
- Run application by: "tns run android" in command line
For logging in with your Google account, you should have a Google developer account. If you don't have one yet, you can get one here .
Register your mobile app by following the wizard in the Developer Console.
- Open GooglePlus project folder in your IDE
- Open command line and write "npm install" to install packages in package.json file
- Open src >> app >> authProviderHelper.ts
- Enter Your clientId of your google developer project in configureOAuthProviderGoogle Function
- Enter redirectUri and urlScheme by reversing clientID as in this example:
clientId: "932931520457-buv2dnhgo7jjjjv5fckqltn367psbrlb.apps.googleusercontent.com",
redirectUri: "com.googleusercontent.apps.932931520457-buv2dnhgo7jjjjv5fckqltn367psbrlb:/auth",
urlScheme: "com.googleusercontent.apps.932931520457-buv2dnhgo7jjjjv5fckqltn367psbrlb",
- Open App_Resources/Android/src/main/AndroidManifest.xml And in "com.tns.NativeScriptActivity" activity add this intent-filter:
<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="Enter-urlScheme-from-auth-providers-folder"/> </intent-filter> - Run application by: "tns run android" in command line