Last active
August 29, 2015 14:19
-
-
Save yagitoshiro/d6e0e17e9566801c8eaf to your computer and use it in GitHub Desktop.
Google Play Servicesの最新版が入っているか確認する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(Ti.Platform.osname == 'android'){ | |
var MapModule = require('ti.map'); | |
var rc = MapModule.isGooglePlayServicesAvailable(); | |
if(rc != MapModule.SUCCESS){ | |
var dialog = Ti.UI.createAlertDialog({ | |
title: 'ご利用の前に', | |
message: '本アプリを快適にご利用頂くために必要なアプリがあります。インストールしますか?', | |
buttonNames: ['インストールする', '今回はキャンセルする'] | |
}); | |
dialog.addEventListener('click', function(e){ | |
if(e.index === 0){ | |
var url = "market://details?id=com.google.android.gms"; | |
Ti.Platform.openURL(url); | |
} | |
}); | |
dialog.show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment