LoginSignup
3
2

More than 3 years have passed since last update.

最近のiOSのTwitterKit...

Last updated at Posted at 2020-04-28

最近は、公式TwitterKitを使ってる人は、もう少ないでしょう。
https://github.com/twitter-archive/twitter-kit-ios

既存アプリのメンテナンスのためにTwitterKitをいじったので雑感など。
(結局のところアプリから削除しましたが)


TwitterKitを利用したアプリをアップデートすると二点問題がありまして、

1.UIWebViewが使われているため、今後アップデートできなくなる
https://ryukasublog.com/uiwebview-deprecated/
【iOS】UIWebViewのDeprecated対応期限は既存アプリは2020年12月まで、新規アプリは2020年4月まで

2.TwitterKitが位置情報を含むので位置情報を使うセキュリティの設定をしなくてはならなくなった。
位置情報は使ってないので今まで通りにApp store connectにアーカイブをsubmitすると以下のエラーになります。

  • Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSLocationWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

これは、TwitterKitがCoreLocationのライブラリを使っているために起きる。

上記の通りplistのNSLocationWhenInUseUsageDescriptionキーに位置情報の使用目的を書けばOKですが、位置情報を使ってないにもかかわらず、ユーザから設定に位置情報利用を利用すための設定が見えてしまってちょっと気持ち悪い。


1.についてはUIWebViewが削除された
https://github.com/savani24/TwitterKit5
を使うことによって回避できました。

2.については回避できず、結局のところTwitterの投稿機能そのものを削除した。
(別の方法のライブラリなり自力でなんとかする方法はありそうですが、そこまではしなかったので。)

3
2
0

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
3
2