2019年1月8日火曜日

Expo v32で位置情報のバックグラウンドタスクがついにできるようになったり、プッシュ通知のインタラクティブなやつなどの変更点的なお話

  • このエントリーをはてなブックマークに追加

Expoがv32にアップデートした。
今回は予定の日付から約一ヶ月遅れぐらいだけど待望のバックグラウンドタスクなどなど。

Expo SDK v32.0.0 is now available

ということで今日は変更点的なお話をば。

■バックグラウンドロケーションとジオフェンシング

We’re excited to announce that this release includes initial support for background location, a highly requested feature from many Expo users. You can now define simple JavaScript tasks in your app and register them to receive location updates in the background. Additionally, you can set up geofencing tasks that are triggered when the device enters or leaves specific geographic regions.

These background features make use of the new TaskManager module, which lets you define tasks to run periodically in the background. If your app isn’t running when one of these events is triggered, TaskManager will boot up your app in the background and execute whichever tasks you’ve defined. 😎

We’ve been working hard on building and testing these modules, but background location is the kind of feature that needs to be tested in the wild before it can be fully mature. Please expect this module’s API and underlying behavior to change in future releases; we recommend treating it as if it were part of DangerZone.

Read more in the Location and TaskManager documentation, and look out for an upcoming blog post that will introduce these features in more detail!

バックグラウンドで位置情報を取得できるようになったり、特定の位置に出入りしたら!みたいな感じでタスクを走らせたりすることができるようになったよとのこと。
TaskManagerっていうモジュールがあるからそれを使えばいいんだけど、将来的に変更とかがあるかもしれないからちょっと注意してねとのこと。
LocationTaskManagerに詳細が書いてあるよ的な。


■インタラクティブなプッシュ通知

With SDK 32, we’ve also added support for notification categories and actions. This means that you can now create actionable notifications that users can interact with, without opening your app! Actions you define show up as buttons to the user, and you can also prompt for text. All user input is passed back into your app.

プッシュ通知でカテゴリとアクションに対応するようになったので、アプリを開かなくても通知画面で何かできるような通知が作れるようになったよ的な。
Notificationのドキュメントはこちら


■READ_SMS permission is gone

The SMS module no longer requires the native Android READ_SMS permission in order to comply with Google’s new policy regarding SMS and Call Log permissions. READ_SMS is not required in order to send an SMS message, and previously it was only used to determine whether the user sent a message or canceled sending.

Starting with SDK 32, Permissions.SMS is gone, and SMS.sendSMSAsync will return a promise that resolves to { result: 'unknown' } on Android, since without the permission there is no way to know whether the user sent the message. If your app uses the SMS module, we recommend you update to SDK 32 as soon as possible in order to comply with Google’s policy.

AndroidでREAD_SMSっていうパーミッションがGoogleのポリシー的な感じでなくなった的な。
このパーミッションは送信するのに必要がなく、ユーザがメッセージを送信したか送信をキャンセルしたかを判断するためにのみ使用されていたとのこと。
ということでSMS.sendSMSAsyncの返り値が{result: 'unknown'}になってしまうとのこと。


■snackの改善

History
Authenticated users can view and recover the state of their snacks after every save.

TypeScript support
TypeScript projects are now supported in Snack!

Custom ESLint rules
If you’d prefer to use different ESLint rules than the default, just create an .eslintrc file, and Snack will use it.

履歴とかTypeScriptサポートとかESLintの独自ルール設定など。


■APIの改善とか

Background Fetch on iOS

In addition to background geolocation and geofencing, we’ve also implemented a more general background fetch module on iOS only. This module allows you to schedule periodic network requests in the background and makes use of the TaskManager module. Read more in the documentation.

iOSでバックグラウンドフェッチができるようになったとのこと。
これもTaskManager関連のモジュールだよ的な。


Add and remove contacts on Android

Previously, all Contacts methods that involved writing data were only available on iOS. These methods are now available on your standalone Android app as well by explicitly adding WRITE_CONTACTS to the android.permissions field in app.json. (These methods are still not available in the Expo Client for Android.)

app.jsonのandroid.permissionsにWRITE_CONTACTSを追加するとAndroidでも連絡先に追加が使えるようになったとのこと。


Bundle download progress fixed in ExpoKit apps

A long overdue quality-of-life improvement — you can see your bundle download progress in development mode in SDK 32 ExpoKit apps!

ExpoKitでバンドルのダウンロード状況がわかるようになったとのこと。


その他

色々と修正されたりなどなど


ってな感じ。
一番大きいところはバックグラウンドタスクがついにサポートされたこと。
まだ位置情報とiOSのバックグラウンドタスクだけだけど、音源再生とかも取り組んでるみたいだし。
それにプッシュ通知でカテゴリとアクションに対応したのも地味に嬉しい感じ。

ちなみにv32でiOSビルドするにはv31と同様に、XCodeを10以上にしておかないとダメだよ的なみたいな。

0 件のコメント:

コメントを投稿

Adsense