イベント・ソース・ベースの通知からのプッシュ通知のマイグレーション
improve this page | report issue概説
IBM Mobile Foundation v8.0 から、イベント・ソース・ベースのモデルはサポートされず、プッシュ通知機能は全面的にプッシュ・サービス・モデルによって使用可能になっています。 以前のバージョンの MobileFirst における既存のイベント・ソース・ベースのアプリケーションを v8.0 に移行する場合は、それらのアプリケーションを新しいプッシュ・サービス・モデルにマイグレーションする必要があります。
マイグレーション時には、これは、使用する API を別のものに変更するということではなく、むしろ、使用するモデル/アプローチを別のものに変更するということである点に留意してください。
例えば、イベント・ソース・ベースのモデルでは、通知を特定のセグメントに送信するためにモバイル・アプリケーション・ユーザーをセグメント化する場合、各セグメントを固有のイベント・ソースとしてモデル化します。 プッシュ・サービス・モデルでは、同じことを実現するために、セグメントを表すタグを定義し、ユーザーが各タグをサブスクライブするようにします。 タグ・ベースの通知は、イベント・ソース・ベースの通知を置き換えるものです。
ジャンプ先
次の表に、2 つのモデル間の比較を示します。
ユーザー要件 | イベント・ソース・モデル | プッシュ・サービス・モデル |
---|---|---|
アプリケーションでプッシュ通知を使用可能にするには |
|
プッシュ資格情報を使用してアプリケーションを構成またはセットアップします。 |
モバイル・クライアント・アプリケーションでプッシュ通知を使用可能にするには |
|
|
モバイル・クライアント・アプリケーションで特定のタグに基づいた通知を使用可能にするには | サポートされません。 | 対象のタグ (タグ名を使用) をサブスクライブします。 |
モバイル・クライアント・アプリケーションで通知を受け取って処理するには | リスナー実装を登録します。 | リスナー実装を登録します。 |
プッシュ通知をモバイル・クライアント・アプリケーションに送信するには |
|
|
定期的な期間 (ポーリング間隔) でプッシュ通知をトリガーするには | イベント・ソース・アダプター内にプッシュ通知を送信する関数を実装し、これを createEventSource 関数呼び出しの一部として実装します。 | サポートされません。 |
フックを名前、URL、およびイベント・タイプで登録するには | プッシュ通知をサブスクライブまたはアンサブスクライブするデバイスのパスに、フックを実装します。 | サポートされません。 |
マイグレーション・シナリオ
Mobile Foundation v8.0 以降、イベント・ソース・ベースのモデルはサポートされなくなり、プッシュ通知機能は全面的にプッシュ・サービス・モデルによって Mobile Foundation で使用可能になります。このモデルは、イベント・ソース・モデルよりもシンプルでアジャイルな代替モデルです。
以前のバージョンの IBM MobileFirst Platform Foundation における既存のイベント・ソース・ベースのアプリケーションは、v8.0 の新しいプッシュ・サービス・モデルにマイグレーションする必要があります。
ジャンプ先のセクション
ハイブリッド・アプリケーション
マイグレーション・シナリオ例では、単一のイベント・ソースまたは複数のイベント・ソース、ブロードキャスト通知またはユニキャスト通知、あるいはタグ通知を使用するアプリケーションを扱っています。
シナリオ 1: アプリケーションで単一のイベント・ソースを使用する既存のアプリケーション
以前のバージョンの MobileFirst では、イベント・ソース・ベースのモデルを使用したプッシュのみがサポートされていたため、アプリケーションは単一のイベント・ソースを使用していました。
クライアント
V8.0.0 にこれをマイグレーションするには、このモデルをユニキャスト通知に変換します。
-
以下のように、アプリケーションで MobileFirst プッシュ・クライアント・インスタンスを初期化し、成功コールバックで、通知を受け取る必要があるコールバック・メソッドを登録します。
MFPPush.initialize(function(successResponse){ MFPPush.registerNotificationsCallback(notificationReceived); }, function(failureResponse){alert("Failed to initialize"); } );
-
通知コールバック・メソッドを実装します。
var notificationReceived = function(message) { alert(JSON.stringify(message)); };
-
モバイル・デバイスをプッシュ通知サービスに登録します。
MFPPush.registerDevice(function(successResponse) { alert("Successfully registered"); }, function(failureResponse) { alert("Failed to register"); } );
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
MFPPush.unregisterDevice(function(successResponse) { alert("Successfully unregistered"); }, function(failureResponse) { alert("Failed to unregister"); } );
-
WL.Client.Push.isPushSupported() を削除し (使用されている場合)、以下を使用します。
MFPPush.isPushSupported (function(successResponse) { alert(successResponse); }, function(failureResponse) { alert("Failed to get the push suport status"); } );
-
サブスクライブ対象のイベント・ソースがないため、以下の
WL.Client.Push
API を削除し、通知コールバックを登録します。registerEventSourceCallback()
subscribe()
unsubscribe()
isSubscribed()
onReadyToSubscribe()
サーバー
- アダプターで以下の WL.Server API を削除します (使用されている場合)。
notifyAllDevices()
notifyDevice()
notifyDeviceSubscription()
createEventSource()
- 同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
-
シナリオ 2: アプリケーションで複数のイベント・ソースを使用する既存のアプリケーション
複数のイベント・ソースを使用するアプリケーションでは、サブスクリプションに基づいてユーザーをセグメント化する必要があります。
クライアント
これは、対象トピックに基づいてユーザー/デバイスをセグメント化するタグにマップされます。 これをマイグレーションするために、このモデルをタグ・ベースの通知に変換できます。
-
以下のように、アプリケーションで MFPPush クライアント・インスタンスを初期化し、成功コールバックで、通知を受け取る必要があるコールバック・メソッドを登録します。
MFPPush.initialize(function(successResponse){ MFPPush.registerNotificationsCallback(notificationReceived); }, function(failureResponse){ alert("Failed to initialize"); } );
-
通知コールバック・メソッドを実装します。
var notificationReceived = function(message) { alert(JSON.stringify(message)); };
-
モバイル・デバイスをプッシュ通知サービスに登録します。
MFPPush.registerDevice(function(successResponse) { alert("Successfully registered"); }, function(failureResponse) { alert("Failed to register"); } );
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
MFPPush.unregisterDevice(function(successResponse) { alert("Successfully unregistered"); }, function(failureResponse) { alert("Failed to unregister"); } );
-
WL.Client.Push.isPushSupported()
を削除し (使用されている場合)、以下を使用します。MFPPush.isPushSupported (function(successResponse) { alert(successResponse); }, function(failureResponse) { alert("Failed to get the push suport status"); } );
- サブスクライブ対象のイベント・ソースがないため、以下の
WL.Client.Push
API を削除し、通知コールバックを登録します。registerEventSourceCallback()
subscribe()
unsubscribe()
isSubscribed()
onReadyToSubscribe()
-
タグにサブスクライブします。
var tags = ['sample-tag1','sample-tag2']; MFPPush.subscribe(tags, function(successResponse) { alert("Successfully subscribed"); }, function(failureResponse) { alert("Failed to subscribe"); } );
-
(オプション) タグからアンサブスクライブします。
MFPPush.unsubscribe(tags, function(successResponse) { alert("Successfully unsubscribed"); }, function(failureResponse) { alert("Failed to unsubscribe"); } );
サーバー
アダプターで以下の WL.Server
API (使用されている場合) を削除します。
notifyAllDevices()
notifyDevice()
notifyDeviceSubscription()
createEventSource()
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
シナリオ 3: アプリケーションでブロードキャスト/ユニキャスト通知を使用する既存のアプリケーション
クライアント
-
以下のように、アプリケーションで MFPPush クライアント・インスタンスを初期化し、成功コールバックで、通知を受け取る必要があるコールバック・メソッドを登録します。
MFPPush.initialize(function(successResponse){ MFPPush.registerNotificationsCallback(notificationReceived); }, function(failureResponse){ alert("Failed to initialize"); } );
-
通知コールバック・メソッドを実装します。
var notificationReceived = function(message) { alert(JSON.stringify(message)); };
-
モバイル・デバイスをプッシュ通知サービスに登録します。
MFPPush.registerDevice(function(successResponse) { alert("Successfully registered"); }, function(failureResponse) { alert("Failed to register"); } );
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
MFPPush.unregisterDevice(function(successResponse) { alert("Successfully unregistered"); }, function(failureResponse) { alert("Failed to unregister"); } );
-
WL.Client.Push.isPushSupported() を削除し (使用されている場合)、以下を使用します。
MFPPush.isPushSupported (function(successResponse) { alert(successResponse); }, function(failureResponse) { alert("Failed to get the push suport status"); } );
-
以下の
WL.Client.Push
API を削除します。onReadyToSubscribe()
onMessage()
サーバー
アダプターで WL.Server.sendMessage()
(使用されている場合) を削除します。
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
シナリオ 4: アプリケーションでタグ通知を使用する既存のアプリケーション
クライアント
-
以下のように、アプリケーションで MFPPush クライアント・インスタンスを初期化し、成功コールバックで、通知を受け取る必要があるコールバック・メソッドを登録します。
MFPPush.initialize(function(successResponse){ MFPPush.registerNotificationsCallback(notificationReceived); }, function(failureResponse){ alert("Failed to initialize"); } );
-
通知コールバック・メソッドを実装します。
var notificationReceived = function(message) { alert(JSON.stringify(message)); };
-
モバイル・デバイスをプッシュ通知サービスに登録します。
MFPPush.registerDevice(function(successResponse) { alert("Successfully registered"); }, function(failureResponse) { alert("Failed to register"); } );
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
MFPPush.unregisterDevice(function(successResponse) { alert("Successfully unregistered"); }, function(failureResponse) { alert("Failed to unregister"); } );
-
WL.Client.Push.isPushSupported()
を削除し (使用されている場合)、以下を使用します。MFPPush.isPushSupported (function(successResponse) { alert(successResponse); }, function(failureResponse) { alert("Failed to get the push suport status"); } );
- 以下の
WL.Client.Push
API を削除します。subscribeTag()
unsubscribeTag()
isTagSubscribed()
onReadyToSubscribe()
onMessage()
-
以下のように、タグにサブスクライブします。
var tags = ['sample-tag1','sample-tag2']; MFPPush.subscribe(tags, function(successResponse) { alert("Successfully subscribed"); }, function(failureResponse) { alert("Failed to subscribe"); } );
-
(オプション) 以下のように、タグからアンサブスクライブします。
MFPPush.unsubscribe(tags, function(successResponse) { alert("Successfully unsubscribed"); }, function(failureResponse) { alert("Failed to unsubscribe"); } );
サーバー
アダプターで WL.Server.sendMessage()
(使用されている場合) を削除します。
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
ネイティブ Android アプリケーション
マイグレーション・シナリオ例では、単一のイベント・ソースまたは複数のイベント・ソース、ブロードキャスト通知またはユニキャスト通知、あるいはタグ通知を使用するアプリケーションを扱っています。
シナリオ 1: アプリケーションで単一のイベント・ソースを使用する既存のアプリケーション
以前のバージョンの MobileFirst では、イベント・ソース・ベースのモデルを使用したプッシュのみがサポートされていたため、アプリケーションは単一のイベント・ソースを使用していました。
クライアント
v8.0 にこれをマイグレーションするには、このモデルをユニキャスト通知に変換します。
-
アプリケーションで MFPPush クライアント・インスタンスを初期化します。
MFPPush push = MFPPush.getInstance(); push.initialize(_this);
-
インターフェース MFPPushNotificationListener を実装し、onReceive() を定義します。
@Override public void onReceive(MFPSimplePushNotification message) { Log.i("Push Notifications", message.getAlert()); }
-
モバイル・デバイスをプッシュ通知サービスに登録します。
push.registerDevice(new MFPPushResponseListener<String>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to register"); } @Override public void onSuccess(String arg0) { Log.i("Push Notifications", "Registered successfully"); } });
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
push.unregisterDevice(new MFPPushResponseListener<String>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to unregister"); } @Override public void onSuccess(String arg0) { Log.i("Push Notifications", "Unregistered successfully"); } });
WLClient.Push.isPushSupported()
(使用されている場合) を削除し、push.isPushSupported();
を使用します。- サブスクライブ対象のイベント・ソースがないため、以下の
WLClient.Push
API を削除し、通知コールバックを登録します。registerEventSourceCallback()
subscribe()
unsubscribe()
isSubscribed()
WLOnReadyToSubscribeListener
およびWLNotificationListener
実装
サーバー
アダプターで以下の WL.Server
API (使用されている場合) を削除します。
notifyAllDevices()
notifyDevice()
notifyDeviceSubscription()
createEventSource()
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
シナリオ 2: アプリケーションで複数のイベント・ソースを使用する既存のアプリケーション
複数のイベント・ソースを使用するアプリケーションでは、サブスクリプションに基づいてユーザーをセグメント化する必要があります。
クライアント
これは、対象トピックに基づいてユーザー/デバイスをセグメント化するタグにマップされます。 Mobile Foundation V8.0.0 にこれをマイグレーションするには、このモデルをタグ・ベースの通知に変換します。
-
以下のように、アプリケーションで
MFPPush
クライアント・インスタンスを初期化します。MFPPush push = MFPPush.getInstance(); push.initialize(_this);
-
インターフェース MFPPushNotificationListener を実装し、onReceive() を定義します。
@Override public void onReceive(MFPSimplePushNotification message) { Log.i("Push Notifications", message.getAlert()); }
-
モバイル・デバイスをプッシュ通知サービスに登録します。
push.registerDevice(new MFPPushResponseListener<String>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to register"); } @Override public void onSuccess(String arg0) { Log.i("Push Notifications", "Registered successfully"); } });
-
(オプション) 次のように、モバイル・デバイスをプッシュ通知サービスから登録抹消します。
push.unregisterDevice(new MFPPushResponseListener<String>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to unregister"); } @Override public void onSuccess(String arg0) { Log.i("Push Notifications", "Unregistered successfully"); } });
WLClient.Push.isPushSupported()
(使用されている場合) を削除し、push.isPushSupported();
を使用します。- サブスクライブ対象のイベント・ソースがないため、以下の
WLClient.Push
API を削除し、通知コールバックを登録します。registerEventSourceCallback()
subscribe()
unsubscribe()
isSubscribed()
WLOnReadyToSubscribeListener
およびWLNotificationListener
の実装-
以下のように、タグにサブスクライブします。
String[] tags = new String[2]; tags[0] ="sample-tag1"; tags[1] ="sample-tag2"; push.subscribe(tags, new MFPPushResponseListener<String[]>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Failed to subscribe"); } @Override public void onSuccess(String[] arg0) { Log.i( "Subscribed successfully"); } });
-
(オプション) 以下のように、タグからアンサブスクライブします。
String[] tags = new String[2]; tags[0] ="sample-tag1"; tags[1] ="sample-tag2"; push.unsubscribe(tags, new MFPPushResponseListener<String[]>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to unsubscribe"); } @Override public void onSuccess(String[] arg0) { Log.i("Push Notifications", "Unsubscribed successfully"); } });
サーバー
アダプターで以下の WL.Server
API (使用されている場合) を削除します。
notifyAllDevices()
notifyDevice()
notifyDeviceSubscription()
createEventSource()
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
シナリオ 3: アプリケーションでブロードキャスト/ユニキャスト通知を使用する既存のアプリケーション
クライアント
-
以下のように、アプリケーションで
MFPPush
クライアント・インスタンスを初期化します。MFPPush push = MFPPush.getInstance(); push.initialize(_this);
-
インターフェース
MFPPushNotificationListener
を実装し、onReceive()
を定義します。@Override public void onReceive(MFPSimplePushNotification message) { Log.i("Push Notifications", message.getAlert()); }
-
モバイル・デバイスをプッシュ通知サービスに登録します。
push.registerDevice(new MFPPushResponseListener<String>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to register"); } @Override public void onSuccess(String arg0) { Log.i("Push Notifications", "Registered successfully"); } });
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
push.unregisterDevice(new MFPPushResponseListener<String>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to unregister"); } @Override public void onSuccess(String arg0) { Log.i("Push Notifications", "Unregistered successfully"); } });
WLClient.Push.isPushSupported()
(使用されている場合) を削除し、push.isPushSupported();
を使用します。- 以下の WLClient.Push API を削除します。
registerEventSourceCallback()
WLOnReadyToSubscribeListener
およびWLNotificationListener
の実装
サーバー
アダプターで WL.Server.sendMessage() API を削除します (使用されている場合)。
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
シナリオ 4: アプリケーションでタグ通知を使用する既存のアプリケーション
クライアント
-
以下のように、アプリケーションで
MFPPush
クライアント・インスタンスを初期化します。MFPPush push = MFPPush.getInstance(); push.initialize(_this);
-
インターフェース MFPPushNotificationListener を実装し、onReceive() を定義します。
@Override public void onReceive(MFPSimplePushNotification message) { Log.i("Push Notifications", message.getAlert()); }
-
モバイル・デバイスをプッシュ通知サービスに登録します。
push.registerDevice(new MFPPushResponseListener<String>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to register"); } @Override public void onSuccess(String arg0) { Log.i("Push Notifications", "Registered successfully"); } });
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
push.unregisterDevice(new MFPPushResponseListener<String>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to unregister"); } @Override public void onSuccess(String arg0) { Log.i("Push Notifications", "Unregistered successfully"); } });
WLClient.Push.isPushSupported()
(使用されている場合) を削除し、push.isPushSupported()
; を使用します。- 以下の
WLClient.Push
API を削除します。subscribeTag()
unsubscribeTag()
isTagSubscribed()
WLOnReadyToSubscribeListener
およびWLNotificationListener
の実装
-
以下のように、タグにサブスクライブします。
String[] tags = new String[2]; tags[0] ="sample-tag1"; tags[1] ="sample-tag2"; push.subscribe(tags, new MFPPushResponseListener<String[]>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Failed to subscribe"); } @Override public void onSuccess(String[] arg0) { Log.i( "Subscribed successfully"); } });
-
(オプション) 以下のように、タグからアンサブスクライブします。
String[] tags = new String[2]; tags[0] ="sample-tag1"; tags[1] ="sample-tag2"; push.unsubscribe(tags, new MFPPushResponseListener<String[]>(){ @Override public void onFailure(MFPPushException arg0) { Log.i("Push Notifications", "Failed to unsubscribe"); } @Override public void onSuccess(String[] arg0) { Log.i("Push Notifications", "Unsubscribed successfully"); } });
サーバー
アダプターで WL.Server.sendMessage()
(使用されている場合) を削除します。
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
ネイティブ iOS アプリケーション
マイグレーション・シナリオ例では、単一のイベント・ソースまたは複数のイベント・ソース、ブロードキャスト通知またはユニキャスト通知、あるいはタグ通知を使用するアプリケーションを扱っています。
シナリオ 1: アプリケーションで単一のイベント・ソースを使用する既存のアプリケーション
以前のバージョンの MobileFirst では、イベント・ソース・ベースのモデルを使用したプッシュのみがサポートされていたため、アプリケーションは単一のイベント・ソースを使用していました。
クライアント
v8.0 にこれをマイグレーションするには、このモデルをユニキャスト通知に変換します。
-
以下のように、アプリケーションで
MFPPush
クライアント・インスタンスを初期化します。[[MFPPush sharedInstance] initialize];
didReceiveRemoteNotification()
で通知処理を実装します。-
モバイル・デバイスをプッシュ通知サービスに登録します。
[[MFPPush sharedInstance] registerDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to register"); } else { NSLog(@"Successfullyregistered"); } }];
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
[MFPPush sharedInstance] unregisterDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to unregister"); } else { NSLog(@"Successfully unregistered"); } }];
-
WLClient.Push.isPushSupported()
を削除し (使用されている場合)、以下を使用します。[[MFPPush sharedInstance] isPushSupported]
- サブスクライブ対象のイベント・ソースがないため、以下の
WLClient.Push
API を削除し、通知コールバックを登録します。registerEventSourceCallback()
subscribe()
unsubscribe()
isSubscribed()
WLOnReadyToSubscribeListener
実装
-
didRegisterForRemoteNotificationsWithDeviceToken
でsendDeviceToken()
を呼び出します。[[MFPPush sharedInstance] sendDeviceToken:deviceToken];
サーバー
アダプターで以下の WL.Server API を削除します (使用されている場合)。
notifyAllDevices()
notifyDevice()
notifyDeviceSubscription()
createEventSource()
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
シナリオ 2: アプリケーションで複数のイベント・ソースを使用する既存のアプリケーション
複数のイベント・ソースを使用するアプリケーションでは、サブスクリプションに基づいてユーザーをセグメント化する必要があります。
クライアント
これは、対象トピックに基づいてユーザー/デバイスをセグメント化するタグにマップされます。 MobileFirst V8.0.0 にこれをマイグレーションするには、このモデルをタグ・ベースの通知に変換します。
-
以下のように、アプリケーションで
MFPPush
クライアント・インスタンスを初期化します。[[MFPPush sharedInstance] initialize];
didReceiveRemoteNotification()
で通知処理を実装します。-
次のように、モバイル・デバイスをプッシュ通知サービスに登録します。
[[MFPPush sharedInstance] registerDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to register"); }else{ NSLog(@"Successfullyregistered"); } }];
-
(オプション) 次のように、モバイル・デバイスをプッシュ通知サービスから登録抹消します。
[MFPPush sharedInstance] unregisterDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to unregister"); }else{ NSLog(@"Successfully unregistered"); } }];
-
WLClient.Push.isPushSupported()
を削除し (使用されている場合)、以下を使用します。[[MFPPush sharedInstance] isPushSupported]
- サブスクライブ対象のイベント・ソースがないため、以下の
WLClient.Push
API を削除し、通知コールバックを登録します。registerEventSourceCallback()
subscribe()
unsubscribe()
isSubscribed()
WLOnReadyToSubscribeListener
実装
didRegisterForRemoteNotificationsWithDeviceToken
でsendDeviceToken()
を呼び出します。-
以下のように、タグにサブスクライブします。
NSMutableArray *tags = [[NSMutableArray alloc]init]; [tags addObject:@"sample-tag1"]; [tags addObject:@"sample-tag2"]; [MFPPush sharedInstance] subscribe:tags completionHandler:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to unregister"); }else{ NSLog(@"Successfully unregistered"); } }];
-
(オプション) 以下のように、タグからアンサブスクライブします。
NSMutableArray *tags = [[NSMutableArray alloc]init]; [tags addObject:@"sample-tag1"]; [tags addObject:@"sample-tag2"]; [MFPPush sharedInstance] unsubscribe:tags completionHandler:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to unregister"); }else{ NSLog(@"Successfully unregistered"); } }];
サーバー
:{: #server-ios-2 }
アダプターで WL.Server
(使用されている場合) を削除します。
notifyAllDevices()
notifyDevice()
notifyDeviceSubscription()
createEventSource()
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
シナリオ 3: アプリケーションでブロードキャスト/ユニキャスト通知を使用する既存のアプリケーション
クライアント
-
以下のように、アプリケーションで MFPPush クライアント・インスタンスを初期化します。
[[MFPPush sharedInstance] initialize];
didReceiveRemoteNotification()
で通知処理を実装します。-
次のように、モバイル・デバイスをプッシュ通知サービスに登録します。
[[MFPPush sharedInstance] registerDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to register"); }else{ NSLog(@"Successfullyregistered"); } }];
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
[MFPPush sharedInstance] unregisterDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to unregister"); }else{ NSLog(@"Successfully unregistered"); } }];
-
WLClient.Push.isPushSupported()
を削除し (使用されている場合)、以下を使用します。[[MFPPush sharedInstance] isPushSupported]
- 以下の
WLClient.Push
API を削除します。registerEventSourceCallback()
WLOnReadyToSubscribeListener
実装
サーバー
アダプターで WL.Server.sendMessage
(使用されている場合) を削除します。
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
シナリオ 4: アプリケーションでタグ通知を使用する既存のアプリケーション
クライアント
-
以下のように、アプリケーションで MFPPush クライアント・インスタンスを初期化します。
[[MFPPush sharedInstance] initialize];
didReceiveRemoteNotification()
で通知処理を実装します。-
次のように、モバイル・デバイスをプッシュ通知サービスに登録します。
[[MFPPush sharedInstance] registerDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to register"); }else{ NSLog(@"Successfullyregistered"); } }];
-
(オプション) 次のように、モバイル・デバイスをプッシュ通知サービスから登録抹消します。
[MFPPush sharedInstance] unregisterDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to unregister"); }else{ NSLog(@"Successfully unregistered"); } }];
WLClient.Push.isPushSupported()
を削除し (使用されている場合)、[[MFPPush sharedInstance] isPushSupported]
を使用します。- サブスクライブ対象のイベント・ソースがないため、以下の
WLClient.Push
API を削除し、通知コールバックを登録します。registerEventSourceCallback()
subscribeTag()
unsubscribeTag()
isTagSubscribed()
WLOnReadyToSubscribeListener
実装
didRegisterForRemoteNotificationsWithDeviceToken
でsendDeviceToken()
を呼び出します。-
以下のように、タグにサブスクライブします。
NSMutableArray *tags = [[NSMutableArray alloc]init]; [tags addObject:@"sample-tag1"]; [tags addObject:@"sample-tag2"]; [MFPPush sharedInstance] subscribe:tags completionHandler:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to unregister"); }else{ NSLog(@"Successfully unregistered"); } }];
-
(オプション) 以下のように、タグからアンサブスクライブします。
NSMutableArray *tags = [[NSMutableArray alloc]init]; [tags addObject:@"sample-tag1"]; [tags addObject:@"sample-tag2"]; [MFPPush sharedInstance] unsubscribe:tags completionHandler:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to unregister"); }else{ NSLog(@"Successfully unregistered"); } }];
サーバー
アダプターで WL.Server.sendMessage
を削除します (使用されている場合)。
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
-
MobileFirst Operations Console を使用して資格情報をセットアップします。 『プッシュ通知設定の構成 (Configuring push notification settings)』を参照してください。
Update GCM settings (PUT) REST API (Android アプリケーションの場合) または Update APNs settings (PUT) REST API (iOS アプリケーションの場合) を使用して、資格情報をセットアップすることもできます。
- 「スコープ・エレメントのマッピング (Scope Elements Mapping)」でスコープ
push.mobileclient
を追加します。 - プッシュ通知をサブスクライバーに送信できるようにするタグを作成します。 プッシュ通知のためのタグの定義を参照してください。
- 以下の方法のいずれかを使用して通知を送信できます。
- MobileFirst Operations Console。 『サブスクライバーへのプッシュ通知の送信 (Sending push notifications to subscribers)』を参照してください。
userId
/deviceId
を使用した Push Message (POST) REST API。
ネイティブ Windows ユニバーサル・アプリケーション
マイグレーション・シナリオ例では、単一のイベント・ソースまたは複数のイベント・ソース、ブロードキャスト通知またはユニキャスト通知、あるいはタグ通知を使用するアプリケーションを扱っています。
シナリオ 1: アプリケーションで単一のイベント・ソースを使用する既存のアプリケーション
v8.0 にこれをマイグレーションするには、このモデルをユニキャスト通知に変換します。
クライアント
-
以下のように、アプリケーションで
MFPPush
クライアント・インスタンスを初期化します。MFPPush push = MFPPush.GetInstance(); push.Initialize(); Implement the interface MFPPushNotificationListener and define onReceive(). class Pushlistener : MFPPushNotificationListener { public void onReceive(String properties, String payload) { Debug.WriteLine("Push Notifications\n properties:" + properties + "\n payload:" + payload); } }
-
モバイル・デバイスをプッシュ通知サービスに登録します。
MFPPushMessageResponse Response = await push.RegisterDevice(null); if (Response.Success == true) { Debug.WriteLine("Push Notifications Registered successfully"); } else { Debug.WriteLine("Push Notifications Failed to register"); }
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
MFPPushMessageResponse Response = await push.UnregisterDevice(); if (Response.Success == true) { Debug.WriteLine("Push Notifications Failed to unregister"); } else { Debug.WriteLine("Push Notifications Unregistered successfully"); }
WLClient.Push.IsPushSupported()
(使用されている場合) を削除し、push.IsPushSupported();
を使用します。- サブスクライブ対象のイベント・ソースがないため、以下の
WLClient.Push
API を削除し、通知コールバックを登録します。registerEventSourceCallback()
subscribe()
unsubscribe()
isSubscribed()
WLOnReadyToSubscribeListener
およびWLNotificationListener
実装
サーバー
アダプターで以下の WL.Server
API (使用されている場合) を削除します。
notifyAllDevices()
notifyDevice()
notifyDeviceSubscription()
createEventSource()
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
- MobileFirst Operations Console の「プッシュ設定」ページで WNS 資格情報をセットアップするか、WNS Settings REST API を使用します。
- スコープ
push.mobileclient
を、MobileFirst Operations Console の「セキュリティー」タブにある「スコープ・エレメントのマッピング」セクションに追加します。 - また、Push Message (POST) REST API を使用し、
userId
/deviceId
を指定することで、メッセージを送信することもできます。
シナリオ 2: アプリケーションで複数のイベント・ソースを使用する既存のアプリケーション
複数のイベント・ソースを使用するアプリケーションでは、サブスクリプションに基づいてユーザーをセグメント化する必要があります。
クライアント
これは、対象トピックに基づいてユーザー/デバイスをセグメント化するタグにマップされます。 MobileFirst V8.0.0 にこれをマイグレーションするには、このモデルをタグ・ベースの通知に変換します。
-
以下のように、アプリケーションで
MFPPush
クライアント・インスタンスを初期化します。MFPPush push = MFPPush.GetInstance(); push.Initialize(); Implement the interface MFPPushNotificationListener and define onReceive(). class Pushlistener : MFPPushNotificationListener { public void onReceive(String properties, String payload) { Debug.WriteLine("Push Notifications\n properties:" + properties + "\n payload:" + payload); } }
-
モバイル・デバイスを IMFPUSH サービスに登録します。
MFPPushMessageResponse Response = await push.RegisterDevice(null); if (Response.Success == true) { Debug.WriteLine("Push Notifications Registered successfully"); } else { Debug.WriteLine("Push Notifications Failed to register"); }
-
(オプション) 以下のように、モバイル・デバイスを IMFPUSH サービスから登録抹消します。
MFPPushMessageResponse Response = await push.UnregisterDevice(); if (Response.Success == true) { Debug.WriteLine("Push Notifications Failed to unregister"); } else { Debug.WriteLine("Push Notifications Unregistered successfully"); }
WLClient.Push.IsPushSupported()
(使用されている場合) を削除し、push.IsPushSupported();
を使用します。- サブスクライブ対象のイベント・ソースがないため、以下の
WLClient.Push
API を削除し、通知コールバックを登録します。registerEventSourceCallback()
subscribe()
unsubscribe()
isSubscribed()
WLOnReadyToSubscribeListener
およびWLNotificationListener
実装
-
以下のように、タグにサブスクライブします。
String[] Tag = { "sample-tag1", "sample-tag2" }; MFPPushMessageResponse Response = await push.Subscribe(Tag); if (Response.Success == true) { Debug.WriteLine("Subscribed successfully"); } else { Debug.WriteLine("Failed to subscribe"); }
-
(オプション) 以下のように、タグからアンサブスクライブします。
String[] Tag = { "sample-tag1", "sample-tag2" }; MFPPushMessageResponse Response = await push.Unsubscribe(Tag); if (Response.Success == true) { Debug.WriteLine("Unsubscribed successfully"); } else { Debug.WriteLine("Failed to unsubscribe"); }
サーバー
アダプターで以下の WL.Server
API (使用されている場合) を削除します。
notifyAllDevices()
notifyDevice()
notifyDeviceSubscription()
createEventSource()
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
- MobileFirst Operations Console の「プッシュ設定」ページで WNS 資格情報をセットアップするか、WNS Settings REST API を使用します。
- スコープ
push.mobileclient
を、MobileFirst Operations Console の「セキュリティー」タブにある「スコープ・エレメントのマッピング」セクションに追加します。 - MobileFirst Operations Console の「タグ」ページでプッシュ・タグを作成します。
- また、Push Message (POST) REST API を使用し、ターゲットとして
userId
/deviceId
/tagNames
を指定することで、通知を送信することもできます。
シナリオ 3: アプリケーションでブロードキャスト/ユニキャスト通知を使用する既存のアプリケーション
クライアント
-
以下のように、アプリケーションで
MFPPush
クライアント・インスタンスを初期化します。MFPPush push = MFPPush.GetInstance(); push.Initialize(); Implement the interface MFPPushNotificationListener and define onReceive(). class Pushlistener : MFPPushNotificationListener { public void onReceive(String properties, String payload) { Debug.WriteLine("Push Notifications\n properties:" + properties + "\n payload:" + payload); } }
-
モバイル・デバイスをプッシュ通知サービスに登録します。
MFPPushMessageResponse Response = await push.RegisterDevice(null); if (Response.Success == true) { Debug.WriteLine("Push Notifications Registered successfully"); } else { Debug.WriteLine("Push Notifications Failed to register"); }
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
MFPPushMessageResponse Response = await push.UnregisterDevice(); if (Response.Success == true) { Debug.WriteLine("Push Notifications Failed to unregister"); } else { Debug.WriteLine("Push Notifications Unregistered successfully"); }
WLClient.Push.isPushSupported()
(使用されている場合) を削除し、push.IsPushSupported();
を使用します。- 以下の
WLClient.Push
API を削除します。registerEventSourceCallback()
WLOnReadyToSubscribeListener
およびWLNotificationListener
実装
サーバー
アダプターで WL.Server.sendMessage()
(使用されている場合) を削除します。
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
- MobileFirst Operations Console の「プッシュ設定」ページで WNS 資格情報をセットアップするか、WNS Settings REST API を使用します。
- スコープ
push.mobileclient
を、MobileFirst Operations Console の「セキュリティー」タブにある「スコープ・エレメントのマッピング」セクションに追加します。 - MobileFirst Operations Console の「タグ」ページでプッシュ・タグを作成します。
- また、Push Message (POST) REST API を使用し、ターゲットとして
userId
/deviceId
/tagNames
を指定することで、通知を送信することもできます。
シナリオ 4: アプリケーションでタグ通知を使用する既存のアプリケーション
クライアント
-
以下のように、アプリケーションで
MFPPush
クライアント・インスタンスを初期化します。MFPPush push = MFPPush.GetInstance(); push.Initialize();
-
インターフェース MFPPushNotificationListener を実装し、onReceive() を定義します。
class Pushlistener : MFPPushNotificationListener { public void onReceive(String properties, String payload) { Debug.WriteLine("Push Notifications\n properties:" + properties + "\n payload:" + payload); } }
-
モバイル・デバイスをプッシュ通知サービスに登録します。
MFPPushMessageResponse Response = await push.RegisterDevice(null); if (Response.Success == true) { Debug.WriteLine("Push Notifications Registered successfully"); } else { Debug.WriteLine("Push Notifications Failed to register"); }
-
(オプション) モバイル・デバイスをプッシュ通知サービスから登録抹消します。
MFPPushMessageResponse Response = await push.UnregisterDevice(); if (Response.Success == true) { Debug.WriteLine("Push Notifications Failed to unregister"); } else { Debug.WriteLine("Push Notifications Unregistered successfully"); }
WLClient.Push.IsPushSupported()
(使用されている場合) を削除し、push.IsPushSupported()
; を使用します。- 以下の
WLClient.Push
API を削除します。subscribeTag()
unsubscribeTag()
isTagSubscribed()
WLOnReadyToSubscribeListener
およびWLNotificationListener
実装
-
以下のように、タグにサブスクライブします。
String[] Tag = { "sample-tag1", "sample-tag2" }; MFPPushMessageResponse Response = await push.Subscribe(Tag); if (Response.Success == true) { Debug.WriteLine("Subscribed successfully"); } else { Debug.WriteLine("Failed to subscribe"); }
-
(オプション) 以下のように、タグからアンサブスクライブします。
String[] Tag = { "sample-tag1", "sample-tag2" }; MFPPushMessageResponse Response = await push.Unsubscribe(Tag); if (Response.Success == true) { Debug.WriteLine("Unsubscribed successfully"); } else { Debug.WriteLine("Failed to unsubscribe"); }
サーバー
アダプターで WL.Server.sendMessage()
(使用されている場合) を削除します。
同じイベント・ソースを使用していた各アプリケーションに対して、以下のステップを実行します。
- MobileFirst Operations Console の「プッシュ設定」ページで WNS 資格情報をセットアップするか、WNS Settings REST API を使用します。
- スコープ
push.mobileclient
を、MobileFirst Operations Console の「セキュリティー」タブにある「スコープ・エレメントのマッピング」セクションに追加します。 - MobileFirst Operations Console の「タグ」ページでプッシュ・タグを作成します。
- また、Push Message (POST) REST API を使用し、ターゲットとして
userId
/deviceId
/tagNames
を指定することで、通知を送信することもできます。
マイグレーション・ツール
マイグレーション・ツールは、MobileFirst Platform Foundation 7.1 のプッシュ・データ (デバイス、ユーザーのサブスクリプション、資格情報、およびタグ) を Mobile Foundation 8.0 にマイグレーションする際に役立ちます。
マイグレーション・ツールは、以下の機能を使用してこのプロセスを簡素化します。
- デバイス、資格情報、タグ、およびユーザー・サブスクリプションを、アプリケーションごとに、MobileFirst Platform Foundation 7.1 データベースから読み取ります。
- このデータを、それぞれのアプリケーション用の Mobile Foundation 8.0 データベース内にある、それぞれの表にコピーします。
- v8.0 アプリケーションでの環境にかかわらず、v7.1 の全環境の全プッシュ・データをマイグレーションします。
マイグレーション・ツールによってユーザー・サブスクリプション関連、アプリケーション環境関連、およびデバイス関連のデータが変更されることは一切ありません。
マイグレーション・ツールを使用する前に、以下の情報を知っておくことが重要です。
- Java バージョン 1.6 以上が必要です。
- MobileFirst Server 7.1 と MobileFirst Server 8.0 の両方がセットアップされ、使用できる状態になっていることを確認します。
- MobileFirst Server 7.1 と MobileFirst Server 8.0 の両方のバックアップをとります。
- 最新バージョンのアプリケーションを MobileFirst Server 8.0 に登録します。
- アプリケーションの表示名は、MobileFirst Platform Foundation 7.1 内でのそのアプリケーションと一致している必要があります。
- PacakgeName/BundleID を覚えておき、同じ値をアプリケーションに対して指定します。
- アプリケーションが MobileFirst Server 8.0 に登録されていない場合、マイグレーションは成功しません。
- アプリケーションの各環境に応じて、スコープ・エレメントのマッピングを指定します。 スコープのマッピングについてもっとよく知る。
手順
- 下記の GitHub リポジトリーからマイグレーション・ツールをダウンロードします。
-
ツールをダウンロードしたら、migration.properties ファイルに以下の詳細を指定します。
値 説明 サンプル値 w.db.type 対象とするデータベースのタイプ pw.db.type = db2 possible values DB2,Oracle,MySql,Derby pw.db.url MobileFirst Platform Foundation 7.1 Worklight データベースの URL jdbc:mysql://localhost:3306/WRKLGHT pw.db.adminurl MobileFirst Platform Foundation 7.1 Admin データベースの URL jdbc:mysql://localhost:3306/ADMIN pw.db.username MobileFirst Platform Foundation 7.1 Worklight データベースのユーザー名 pw.db.username=root pw.db.password MobileFirst Platform Foundation 7.1 Worklight データベースのパスワード pw.db.password=root pw.db.adminusername MobileFirst Platform Foundation 7.1 Admin データベースのユーザー名 pw.db.adminusername=root pw.db.adminpassword MobileFirst Platform Foundation 7.1 Admin データベースのパスワード pw.db.adminpassword=root pw.db.urlTarget MFP 8.0 データベースの URL jdbc:mysql://localhost:3306/MFPDATA pw.db.usernameTarget MFP 8.0 データベースのユーザー名 pw.db.usernameTarget=root pw.db.passwordTarget MFP 8.0 データベースのパスワード pw.db.passwordTarget=root pw.db.schema MobileFirst Platform Foundation 7.1 Worklight データベースのスキーマ WRKLGT pw.db.adminschema MobileFirst Platform Foundation 7.1 Admin データベースのスキーマ WLADMIN pw.db.targetschema Mobile Foundation 8.0 Worklight データベースのスキーマ MFPDATA runtime MobileFirst Platform Foundation 7.1 のランタイム名 runtime=worklight applicationId MobileFirst Platform Foundation 7.1 に登録されているアプリケーションの、コンマ (,) 区切りのリストを指定します。 HybridTestApp,NativeiOSTestApp targetApplicationId Mobile Foundation 8.0 に登録されているアプリケーションの、コンマ (,) 区切りのリストを指定します。 com.HybridTestApp,com.NativeiOSTestApp - applicationID と targetApplicationId の両方の値が、正しい順序で指定されていることを確認します。 マッピングは、1 対 1 (つまり n 対 n) の方式で行われます。すなわち、applicationId リスト内の最初のアプリケーションのデータが、targetApplicationId リスト内の最初のアプリケーションにマイグレーションされます。
- targetApplicationId リストには、アプリケーションの packageName/BundleId を指定します。 つまり、MobileFirst Platform Foundation 7.1 の TestApp1 ならば、targetApplicationId は com.TestApp1 となります (TestApp1 の packageName/BundleId)。 これは、MobileFirst Platform Foundation 7.1 では applicationId はアプリケーション名であるのに対し、MobileFirst Server 8.0 ではこれは、アプリケーションの環境に基づいた packageName/BundleId/packageIdentityName であるためです。
-
以下のコマンドを使用してツールを実行します。
java -jar mfp-push-data-migration.jar path-to-migration.properties
- ツールの .jar ファイルとこのプロパティー・ファイルが別々の場所に配置されている場合は、path-to-migration.properties を migration.properties のパスで置き換えます。 そうでない場合は、コマンドからパスを削除します。
*必要なライブラリーが含まれた lib フォルダーは、ツールの .jar ファイルと同じ場所に配置してください。
Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.