Try App Invites for Android を翻訳してみました。
何かお気づきの点がありましたらコメントを頂ければと思います。
以下、関連する投稿へのリンクです。
■ App Invites for Android (Beta) 公式 翻訳
■ Try App Invites for Android 公式 翻訳
■ Add App Invites to Your App 公式 翻訳
■ Integrate App Invites with Google Analytics 公式 翻訳
Try App Invites for Android
Use our Android sample app to see how App Invites works, or add App Invites to your existing app.
Required: The latest versions of Android Studio and Google Play Services.
App Invitesがどのように動くのか、またどのようにApp Invitesをあなたの既存アプリに追加するのかを確認するために、私たちのサンプルアプリを利用してください。
必要なもの:最新のAndroid StudioとGoogle Play Services.
(1) Get the project
If this is your first time using a Google services sample, check out the google-services repository.
$ git clone https://github.com/googlesamples/google-services.git
Open Android Studio.
Select File > Open, browse to where you cloned the
google-services
repository, and opengoogle-services/android/appinvites
.
Google servicesのサンプルを使うのが初めてならば、google-services repositoryを
チェックアウトしてください。
$ git clone https://github.com/googlesamples/google-services.git
Android Studioを起動してください。
File > Openを選択し、google-services
repositoryを選択してgoogle-services/android/appinvites
を開きます。
(2) Get a configuration file
To use the sample, you need to provide some additional information to get a configuration file and finish setting up your project. Use the package name
com.google.android.gms.samples.appinvite
for the sample.After you complete the registration, download the
google-services.json
file to add to your project.
サンプルを使用するにあたり、設定ファイルを取得してプロジェクトのセットアップを完了するため、あなたはいくつかの追加情報を提供する必要があります。 このサンプルにはcom.google.android.gms.samples.appinvite
というパッケージ名を使用してください。
登録が完了した後、あなたのプロジェクトに追加するgoogle-services.json
ファイルをダウンロードしてください。
(3) Add the configuration file to your project
Copy the
google-services.json
file you just downloaded into theapp/
ormobile/
directory of your Android Studio project. Open the Android Studio Terminal pane:Mac/Linux:
$ mv path-to-download/Downloads/google-services.json app/
Windows:
$ move path-to-download/Downloads/google-services.json app/`
ダウンロードしたgoogle-services.json
ファイルをAndroid Studioプロジェクトのapp/
またはmobile/
ディレクトリにコピーしてください。 Android Studioターミナルを開き下記を実行します。
Mac/Linuxの場合:
$ mv path-to-download/Downloads/google-services.json app/
Windowsの場合:
$ move path-to-download/Downloads/google-services.json app/`
(4) Run the sample
Now you're ready to build the sample and run it from Android Studio.
Build the sample and click the run button and select a connected device or emulator.
Once the application loads, try sharing an invite! Your invited friends will see the invite, but not be able to use the sample app because it's not registered in the Play store.
これでAndroid Studioからサンプルをビルドして実行する準備が出来ました。
サンプルをビルドして実行ボタンをクリックして、接続されたデバイスまたはエミュレーターを選択します。
アプリがロードされたら、招待状をシェアしてみてください! あなたが招待した友人は招待状を見るでしょう。しかしGoogle Playストアに登録されていないためサンプルアプリを使うことは出来ません。
(5) How it works
The application triggers invites via a custom intent that displays the sharing dialog.
private void onInviteClicked() { Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title)) .setMessage(getString(R.string.invitation_message)) .setDeepLink(Uri.parse(getString(R.string.invitation_deep_link))) .build(); startActivityForResult(intent, REQUEST_INVITE); }
アプリはシェアするダイアログを表示するカスタムintentにより招待を行います。
private void onInviteClicked() {
Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title))
.setMessage(getString(R.string.invitation_message))
.setDeepLink(Uri.parse(getString(R.string.invitation_deep_link)))
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
(6) Next steps
Dive into the details and see how to handle receiving deeplinks and displaying post install guidelines.
Did you have a good experience? Run into trouble? Let us know!
詳細に入り、ディープリンクの受信とインストール後の表示をどのように処理するかのガイドラインを参照してください。
うまく出来ましたか? トラぶりましたか? 私たちに教えてください!