All Projects → appcelerator-modules → ti.playservices

appcelerator-modules / ti.playservices

Licence: other
Titanium module for Google Play Services

Programming Languages

javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to ti.playservices

ti.admob
Use the Google AdMob SDK on iOS and Android with Titanium
Stars: ✭ 51 (+168.42%)
Mutual labels:  native, titanium, appcelerator, titanium-module
titanium-firebase-analytics
Use the Firebase Analytics SDK in Axway Titanium 🚀
Stars: ✭ 33 (+73.68%)
Mutual labels:  native, titanium, appcelerator, axway
titanium-arkit
Use the iOS 11 ARKit API in Axway Titanium
Stars: ✭ 28 (+47.37%)
Mutual labels:  native, titanium, appcelerator, axway
ti.paint
Touch-based painting with the Titanium SDK.
Stars: ✭ 27 (+42.11%)
Mutual labels:  native, titanium, appcelerator, titanium-module
griffin-app-opensource
The Axway Griffin App goes open source!
Stars: ✭ 19 (+0%)
Mutual labels:  native, titanium, appcelerator, axway
av.imageview
Titanium native ImageView module that extends the default Titanium ImageView with more capabilities and a different caching system.
Stars: ✭ 97 (+410.53%)
Mutual labels:  native, titanium, appcelerator, titanium-module
titanium-turbo
Axway Amplify module that adds some enhancements for Appcelerator Titanium Alloy
Stars: ✭ 15 (-21.05%)
Mutual labels:  native, titanium, appcelerator, axway
titanium-alternate-icons
Leverage the ability to change the app icon in iOS 10.3+
Stars: ✭ 24 (+26.32%)
Mutual labels:  titanium, appcelerator, titanium-module
nl.fokkezb.loading
The widget provides a simple loading mask that can be easily styled and configured.
Stars: ✭ 96 (+405.26%)
Mutual labels:  titanium, appcelerator, axway
ti.exoplayer
A native control for playing videos for Titanium. Based on Google ExoPlayer, using Titanium.Media.VideoPlayer API.
Stars: ✭ 17 (-10.53%)
Mutual labels:  titanium, appcelerator, axway
titanium-dark-mode
Full support for iOS 13+ / Android 10+ dark mode (semantic colors and images) in Appcelerator Titanium
Stars: ✭ 26 (+36.84%)
Mutual labels:  titanium, appcelerator, axway
titanium-apple-sign-in
Use the iOS 13+ Apple Sign In API with Titanium
Stars: ✭ 29 (+52.63%)
Mutual labels:  titanium, appcelerator, titanium-module
ti.moddevguide
Appcelerator Titanium native Module Guide
Stars: ✭ 39 (+105.26%)
Mutual labels:  titanium, appcelerator, titanium-module
Titanium mobile
🚀 Native iOS- and Android- Apps with JavaScript
Stars: ✭ 2,553 (+13336.84%)
Mutual labels:  native, titanium, appcelerator
titanium-material
Use the native Material UI/UX framework (https://github.com/CosmicMind/Material) in Titanium!
Stars: ✭ 14 (-26.32%)
Mutual labels:  native, titanium, appcelerator
ti.map
Use native Apple Maps & Google Maps in iOS and Android with Axway Titanium
Stars: ✭ 49 (+157.89%)
Mutual labels:  native, titanium, appcelerator
ti.coremotion
Support for the native iOS CoreMotion framework in Appcelerator Titanium
Stars: ✭ 15 (-21.05%)
Mutual labels:  native, titanium, appcelerator
titanium-web-dialog
Use the SFSafariViewController (iOS) and Chrome Pages (Android) in Titanium.
Stars: ✭ 28 (+47.37%)
Mutual labels:  native, titanium
titanium-paypal
💰 Use the PayPal iOS-SDK 2.x with Titanium Mobile.
Stars: ✭ 22 (+15.79%)
Mutual labels:  native, appcelerator
ti.youtube
A small library to get the URL of the desired YouTube video ID to use it natively in Ti.Media.VideoPlayer.
Stars: ✭ 13 (-31.58%)
Mutual labels:  titanium, titanium-module

ti.playservices

To provide Google Play Services for Titanium modules and applications

Requirements

  • Titanium Mobile SDK 7.0.0 or later (release 12/2017)

Example

Add the module as a dependency to your application by adding a <module> item to the <modules> element of your tiapp.xml file:

<ti:app>
  ...
  <modules>
    <module platform="android">ti.playservices</module>
  </modules>
  ...
</ti:app>

Use require() to access the module from JavaScript:

    const PlayServices = require('ti.playservices');

The PlayServices variable is a reference to the module. Make API calls using this reference:

    const playServicesAvailable = PlayServices.isGooglePlayServicesAvailable();

As of version 17.1.0 (only supported by Titanium Mobile SDK 9.0.0 and above), the ti.playservices module will automatically check if Google Play Services is installed and up-to-date on the device upon app startup. If not, the module will prompt the end-user to install/update it. The main app script (ie: app.js or alloy.js) will not be executed until the end-user has successfully installed/updated Google Play Services or if it is already up-to-date.

If you do not want ti.playservices to check Google Play Services on app startup, then you can disable the above mentioned behavior by setting the below property in the tiapp.xml file.

<ti:app xmlns:ti="http://ti.appcelerator.org">
	<property name="ti.playservices.validate.on.startup" type="bool">false</property>
</ti:app>

If you disable the above behavior, then it is highly recommended to detect availability issues yourself as shown below.

const PlayServices = require('ti.playservices');

const win = Ti.UI.createWindow({ backgroundColor: 'gray' });
const btn = Ti.UI.createButton({ title: 'CHECK PLAY SERVICES' });

btn.addEventListener('click', () => {
    PlayServices.makeGooglePlayServicesAvailable((e) => {
        if (e.success) {
            alert(`Play Services: ${PlayServices.GOOGLE_PLAY_SERVICES_VERSION_CODE}`);
            // Use Play Services
        } else {
            alert(`Play Services is not available.`);
        }
    });
});

win.add(btn);
win.open();

To include Play Services libraries with your native module include the module as a dependency by adding a <module> item to the <modules> element of your timodule.xml file:

<ti:module>
  ...
  <modules>
    <module platform="android">ti.playservices</module>
  </modules>
  ...
</ti:module>

For a detailed API example please see android/example/app.js

Build

  1. Create a lib folder in the android directory
  2. Run npm install node . from the updater directory
  3. Run npm install && node . from the updater directory
  4. Run appc run -p android --build-only from the android directory

Author

Axway

License

Apache 2.0

Contributing

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].