置頂文章

2015年12月15日 星期二

[Android] - Android 6.0以後的權限設定與GCM

因應Android 6.0以後對於手機權限的管理方式(如存取相機、位置、聯絡人、手機、儲存、日曆權限等等),在舊版的開發方式上會導致crash。
必須增加版本判斷來對權限有不同的寫法

權限的簡介
http://developer.android.com/intl/zh-tw/training/permissions/index.html

即時要求權限的範例:
http://developer.android.com/intl/zh-tw/training/permissions/requesting.html

權限列表資訊
http://developer.android.com/intl/zh-tw/guide/topics/security/permissions.html#permission-groups


GCM:
按照之前舊版的方式取得DeviceId在6.0的手機上會crash
所以去爬了一下官方文件
範例參考:
https://developers.google.com/instance-id/guides/android-implementation

沒有留言:

張貼留言