Git Product home page Git Product logo

apnstoken-to-fcmtoken's Introduction

apntoken-to-fcmtoken

iOSアプリのAPNSTokenをFCM(Firebase Cloud Messaging)のToken(registrationID)に変換するツールを作りました。

https://hikarusato.github.io/apnstoken-to-fcmtoken/ APNS TO FCM TOKEN

作った経緯

iOSアプリのPUSH通知をFCMで行うようにするとAndroidアプリと一緒にPUSH通知関連の管理ができるし1リクエストで複数人にプッシュ通知できるし、かなり便利だと思います。しかも、iOSアプリにFirebaseのSDKを組み込む前にできてしまう。 でも、それ(iOSアプリにFirebaseのSDKを組み込む前にFCMでプッシュ通知)をやるためには下記のAPIを利用する必要があり、次のような制限があります。

https://developers.google.com/instance-id/reference/server#create_registration_tokens_for_apns_tokens

  • GUIで変換するツールが無い(もしかしたら、私の探し方が悪いだけ存在しているのかもしれませんが)ので、エンジニア以外に変換をお願いできない。
  • 1度のAPIリクエストにのせられるAPNS Tokenは100個まで。

これらを解消するため作成しました。

利用対象

ニッチだと思いますが、下記のいずれかだと思います。

  • iOSアプリにFirebaseのSDKを組み込む前にFCMでプッシュ通知がしたい。
  • あるいは、FirebaseのSDKを組み込んだがFCMのToken(registrationID)をサーバーのDBに保存できていない。

使い方

1. FCM Server KeyのところにFirebaseのプロジェクトの設定->クラウドメッセージング->サーバーキーを入力。 2. iOSアプリのBundleIDを入力。 3. Sandboxの場合チェックオンする。 4. APNSTokenが改行区切りで入ったUTF8のcsvファイルをドラッグ&ドロップする。

test001a775fa3f12d4c714058a799f47ca5aa1028839e874f1080ceb8c4fe3b
test002cc4d396422d1a257b93f3bc0584de40fa961f4cfff09112a6f89890c9
test0037f30c67ce13756b28c90b2a2a2c4f4602a6032c4c58ec494112e8c3b7
test00470cc1c7885356c22ee185dba8c4c292906fb2652a1a0c09a0bae26119
test005a5378d2e78268e4a2975a9e166b137f8dd757b9f52130edeb1fc766a1

5. [START CONVERT]ボタンをクリックする。下記のような感じでLogの部分に進捗が表示されて、終わったらファイル保存ダイアログが開きます。 apns_to_fcm.gif 作成されるcsvファイルには、

  • 1カラム目には変換後のFCMToken(RegistrationID)
  • 2カラム目には変換前のAPNSToken

が入っています。

動作環境

次の環境で動作確認済み。

macOS Sierra(v10.12.6)

  • Chrome v63.0.3239.108
  • Safari v11.0.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.