2019年9月21日土曜日

Expo v35でiOS13対応でDark ModeとかApple IDでログインとかデバイス系の新しいAPIとか使えるようになったよ的なお話

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

Expoがv35にアップデートした。
今回も前回から約2ヶ月以内となかなかのスピード。
主にiOS13という新しいバージョンへの対応がメイン的なお話みたい。
ちなみに残念ながらReact Nativeのバージョンはまだ0.59.8だったりする。

Expo SDK 34 is now available

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

■ダークモード対応

Undoubtedly iOS 13’s most exciting new feature is Dark Mode. We’ve added the react-native-appearance module so that you can listen to your users’ appearance preferences and update your app’s UI accordingly. Check out the Appearance module docs for more information.

It will be up to you to implement a dark style for your app. Since everyone’s UI tends to look very different we are not providing any UI primitives that automatically respond to Dark Mode. If you’re using React Navigation, you can enable a built-in dark theme for your navigation components; see the Themes documentation for more info.

react-native-appearanceっていう新しいモジュールを作ったよ的な。
これでiPhoneがダークモードかどうかが判別できるから、自動でダークモードスタイルになるとかそういうのはないから、それに応じてスタイルを変えちゃってよ的な。
react-navigationを使っているとダークテーマみたいな機能を使えるからreact-navigationのドキュメントをチェックしてね的な。


■Apple ID認証

Another new feature introduced with iOS 13 is Apple Authentication, or “Sign in with Apple.” If your app uses any third-party login service such as Google or Facebook login, Apple will now require that you also offer Apple Authentication as an option in order for your iOS app to be approved during App Store Review. Further, you must use Apple’s proprietary button in your app’s UI.

We’ve added a new AppleAuthentication module, which provides login functionality as well as the AppleAuthenticationButton UI component. If you use third-party logins, you’ll need to update your app to include this module before submitting an iOS 13 update to the App Store. Check out the AppleAuthentication module docs for more information.

iOS13でApple ID認証が追加されたのでモジュール用意したよ的な。
GoogleでログインとかFacebookでログインみたいなサードパーティのログインサービスを使っていると、App Storeの審査で言われることがあるから、Apple IDで認証するコンポーネントを組み込んで提出しましょうみたいな。
詳しいことはAppleAuthenticationモジュールのドキュメントをチェックしてね的な。


■Expo Webの改善

SDK 35 comes with a bunch of awesome improvements to Expo Web. First, we’re rolling out support for server-side rendering; all Expo packages now support SSR. To make deploying your site even more painless, we’re also adding easy integration with Next.js and the ZEIT Now service! Documentation around this integration, as well as information about limitations, is available here.

全てのExpo製パッケージがSSR(サーバーサイドレンダリング)に対応したよ的な。
それにもっと便利にするためにNextjsとかZEITのNowとかこれらとも統合できるように進めている的な感じだったり。
現段階でも使えるっちゃ使えるのでUsing Next.js with Expo for Webっていうドキュメントをチェックしてね。


■デバイスとか環境に関しての新しいモジュール

We’ve added a number of small modules for requesting information about various aspects of the device and environment in which your app is running. These modules mostly provide constant fields, as well as some getter methods and events, that are accessible to all native apps on each platform.

* Device provides information about the physical device/manufacturer as well as the operating system.
* Application provides information about your application and its environment.
* Battery provides information about the power state of the device.
* Network provides information about the device’s current network connection.
* Cellular provides information about the device’s current cellular network and telephony state.

Check out the API docs for more information on each of these modules.

ちっちゃいけどデバイス情報とかアプリケーションについてとかバッテリーとかそういったいろんな情報を取得できるようなAPIを用意したよ的な。
Deviceはデバイス名とか製造年月日とかos名とかそういったもの。
Applicationはアプリ名とかバンドルIDとかバージョンとかそういったもの。
Batteryは残りのバッテリー量とか充電中とか省電力モードとかそういったもの。
NetworkはwifiかそうでないかとかIPアドレスとか機内モードとかそういったもの。
Cellularはキャリアとかキャリアの国コードとか4Gかどうかとかそういったもの。

app.jsonで取得していたものもあるし、そうじゃなく新しく取得できるようになったりもあるみたいな。
個人的にはバッテリー量とかwifiとか4Gかどうかって動画とか扱うときに地味に便利だったりするんじゃないかなと思ったり。


■Dropping SDKs 31 and 32 from the Expo client

We routinely drop SDK versions that have low usage, but we’ve dropped more versions than usual with this release. SDK 33 was the first version that included 64-bit support, and in order for us to update the Expo client on Google Play, every SDK version we include must have 64-bit support.

This release sees the end of life for SDKs 31 and 32. As usual, your standalone apps built with these SDK versions will continue to work; however, SDK 31 and 32 projects will no longer work within the latest version of Expo Client.

At this time, you can still run expo build for SDK 31 and 32 projects. Note, however, that you must upgrade to 33 or later in order to submit an updated APK to Google Play due to the 64-bit requirement. We will remove support for SDKs 31 and 32 in expo build in a future release.

If you still need to test a project running SDK 31 or 32, you can download this Android client version and this iOS client version.

いつも通りのExpoクライアントでサポートしなくなるよバージョンのお知らせ。
Expo 31と32も切り捨てるよ的な。


■Android Branch support

For those unaware, we previously supported the Branch module in the managed workflow, but back in April we chose to remove it on Android. Good news — managed projects built with SDK 34 and above now have optional Branch support that can be configured at build-time!

To add the Branch module to your standalone build, run expo install expo-branch, add your Branch API Key to your app.json under android.config.branch.apiKey, and then ensure expo-branch is a listed dependency in your package.json at the time of running expo build:android. If all of these steps have been done correctly, the builder will bundle the Branch module into your APK file.

We believe that developers should be aware of the inherent risk when including a module that relies on another service. For more details, please read this blog post.

前にもお知らせしたけど的な。
AndroidではBranchが入っていたためにストアから消されてしまうということがあったからそのためにブランチをマネージドワークフロー(普通のExpoプロジェクト)では削除していたんだよ的な。
Expo SDK34以上だとビルド時にブランチをサポートするかどうか的なオプションを設定できるようにしたみたいな。
スタンドアローンビルドにBranchを入れたかったらexpo install expo-branchを走らせてAPIキーをapp.jsonに入れればOK。
他のサービス使うようなモジュールが入ってるとリスクもあったりするし認識しないとだよね的な。

詳しくはこのブログ記事を見てね的な。


■API improvements and additions

Inline requires
We’ve added a lazyImports option to babel-preset-expo which allows lazy initialization and inline requires of packages. Check out the documentation on the babel-preset-expo README.

* Admob: add support for serving non-personalized ads. (Related PR.)
* Calendar: add getDefaultCalendarAsync method on iOS. (Related PR.)
* MediaLibrary: added createdAfter and createdBefore options to getAssetsAsync to allow requesting assets within a specific timeframe. (Related PR.)
* Notifications: added iosDisplayInForeground option to allow displaying notifications on iOS when your app is in the foreground. (Related PR.)
* Added react-native-shared-element to Expo client and standalone/ExpoKit apps (Docs, PR)
* Added react-native-safe-area-context to Expo client and standalone/ExpoKit apps (Docs, PR)

Other fixes and improvements
For a full list of improvements and bugfixes in this release, refer to the CHANGELOG. A few other highlights:

* BackgroundFetch: fixed occasional exceptions regarding mutating an array while being enumerated. (Related PR.)
* Location: background mode is no longer erroneously required to use geofencing. (Related PR.)
* ImagePicker: fixed launchImageLibraryAsync on iOS 13. (Related PR.)

babel-preset-expoの設定でlazyImportsを追加したよ的な。
このlazyImportsを使うと、依存関係に副作用がなかったりとか、依存関係を事前に評価する必要がなかったりすることがあるからアプリの初期読み込み速度がアップすることがあるみたい。
ここに詳しく書いてあるから見てね的な。

あとはAdmobとかCalendarとか色々とアップデートしたり、Backgrounfetchとか修正したり的な。
CHANGELOGを見ましょうみたいな。


■Library updates

ライブラリアップデートしたよ的な感じなので省略。


■Breaking Changes

* Admob: all Admob ads now require a new configuration value in app.json, expo.[platform].config.googleMobileAdsAppId. The value can be found by following the guide in this Google Support answer. (Related PR.)
* Contacts: removed the note field on iOS as this now requires a separate entitlement in iOS 13. (Related PR.)
* Facebook: upgraded the underlying iOS library to v5.4.1. This upgrade removed support for all login behaviors other than browser. The behavior parameter has been removed from the TS type declaration and will no longer have any effect. (Related PR.)
* Google: loginAsync now accepts a redirectUrl value for apps running in the Expo Client. Previously, it would ignore this, so if you are passing a value, make sure to follow the guidelines. (Related PR.)
* Localization: replaced the country constants with region. This is now only available on iOS and Web. (Related PR.)

これらライブラリ使っている人はちゃんと見ておきましょう的な。


■Upgrading Your App / Updating ExpoKit to SDK 35

いつも通りなので省略。


ってな感じ。
iOS13対応がメインだったりするんだけど、バッテリーとかデバイス情報とか地味に便利なAPIが登場したのは大きいかなと。
あと何と言ってもすごいのがNextjs使えるよ的なところ。
なんか何を目指してるのかがよくわからないぐらいすごい。
これは将来的にExpoのみでアプリもWebも余裕で開発できる的な感じになるだろうから先に試してみても面白いんじゃないかな的なみたいな。

0 件のコメント:

コメントを投稿

Adsense