GithubHelp home page GithubHelp logo

bangslosan / ti.googlesignin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hansemannn/titanium-google-signin

0.0 2.0 0.0 10.53 MB

Use the native Google Sign In SDK in Appcelerator Titanium.

License: Other

JavaScript 5.53% Objective-C 94.47%

ti.googlesignin's Introduction

Ti.GoogleSignIn

Build Status License Contact

Summary

Ti.GoogleSignIn is an open-source project to support the Google SignIn iOS-SDK in Appcelerator's Titanium Mobile.

Requirements

  • Titanium Mobile SDK 5.5.1.GA or later
  • iOS 7.1 or later
  • Xcode 7.3 or later

Download + Setup

Download

Setup

Unpack the module and place it inside the modules/iphone/ folder of your project. Edit the modules section of your tiapp.xml file to include this module:

<modules>
    <module platform="iphone">ti.googlesignin</module>
</modules>

Add the following URL types to your plist section of the tiapp.xml:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>google</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <!-- Example: com.googleusercontent.apps.123456789-xxxxxxxx -->
            <string>YOUR_REVERSE_CLIENT_ID</string>
        </array>
    </dict>
</array>

Initialize the module by setting the Google SignIn API key you can get from the Google API Console.

var Google = require('ti.googlesignin');
Google.initialize({
    clientId: '<client-id>',

    // Optional properties:
    serverClientId: '<server-client-id>',
    scopes: ['https://www.googleapis.com/auth/plus.login'], // See https://developers.google.com/identity/protocols/googlescopes for more
    language: 'de', // Or 'de-DE', 'en-US', etc.
    loginHint: 'Titanium rocks!',
    hostedDomain: 'https://my-hosted-domain.com',
    shouldFetchBasicProfile: false, // Default: true
    openIDRealm: 'my-openID-realm',
});

Methods

  • signIn
  • signInSilently
  • signOut
  • disconnect
  • hasAuthInKeychain
  • currentUserImageURLWithSize

Properties

  • currentUser

Events

  • login
  • disconnect
  • cancel
  • error
  • load
  • open
  • close

The login- and disconnect events include a user key that includes the following user-infos:

id, scopes, serverAuthCode, hostedDomain, profile, authentication

Build

If you want to build the module from the source, you need to check some things beforehand:

  • Set the TITANIUM_SDK_VERSION inside the ios/titanium.xcconfig file to the Ti.SDK version you want to build with.
  • Build the project with appc run -p ios --build-only
  • Check the releases tab for stable pre-packaged versions of the module

Features

TBA

Example

For a full example, check the demos in example/app.js and example/clustering.js.

Author

Hans Knoechel (@hansemannnn / Web)

License

Apache 2.0

Contributing

Code contributions are greatly appreciated, please submit a new pull request!

ti.googlesignin's People

Contributors

hansemannn avatar

Watchers

James Cloos 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.