LoginSignup
9

More than 5 years have passed since last update.

Titanium3.4でiOS8の位置情報をとる際の設定

Posted at

tiapp.xmlに設定追加しないとだめなんですね。

tiapp.xml
<ios>
    <plist>
        <dict>
            <key>NSLocationWhenInUseUsageDescription</key>
            <string>Test NSLocationWhenInUseUsageDescription</string>
            <key>NSLocationAlwaysUsageDescription</key>
            <string>Test NSLocationAlwaysUsageDescription</string>
        </dict>
    </plist>
</ios>

  • 使用中のみ許可

    NSLocationWhenInUseUsageDescription

  • 常に許可

    NSLocationAlwaysUsageDescription

参考ページ

http://qiita.com/koogawa/items/6ec24ca3201977e9642b

https://gist.github.com/benbahrenburg/c4c992c8c61d197510ea

うまくいくと位置情報を取得しようとした際に、確認ダイアログが表示されます。

kobito.1412846910.673153.png

 サンプルソース

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9