Commit be3450fc by Takatoshi Miura

FCMキー取得失敗時にダイアログ表示するように仕様変更

parent 5065a010
...@@ -1546,4 +1546,5 @@ ...@@ -1546,4 +1546,5 @@
<string name="msg_location_device_no_allow">端末の設定から位置情報をONにしてください。</string> <string name="msg_location_device_no_allow">端末の設定から位置情報をONにしてください。</string>
<string name="msg_ble_connect_success">%1$sと接続になりました。%1$sを操作してください。</string> <string name="msg_ble_connect_success">%1$sと接続になりました。%1$sを操作してください。</string>
<string name="select_spp_device_title">シリアル通信機器選択</string> <string name="select_spp_device_title">シリアル通信機器選択</string>
<string name="msg_get_device_token_fail">プッシュ通知サービスに必要なデバイストークンの取得に失敗しました。\nGooglePlayServiceアプリがインストールされているか確認してください。</string>
</resources> </resources>
...@@ -1543,4 +1543,5 @@ ...@@ -1543,4 +1543,5 @@
<!-- atform --> <!-- atform -->
<string name="pairing_search_scan">주사</string> <string name="pairing_search_scan">주사</string>
<string name="pairing_search_stop">멈추다</string> <string name="pairing_search_stop">멈추다</string>
<string name="msg_get_device_token_fail">알림 서비스에 필요한 단말기 토큰을 취득하지 못했습니다. \nGooglePlayService가 인스톨 되어있는지 확인해 주세요.</string>
</resources> </resources>
\ No newline at end of file
...@@ -1546,4 +1546,5 @@ ...@@ -1546,4 +1546,5 @@
<string name="msg_location_device_no_allow">Please set the location information to ON in the device setting.</string> <string name="msg_location_device_no_allow">Please set the location information to ON in the device setting.</string>
<string name="msg_ble_connect_success">It is now connected to the %1$s.Operate the %1$s.</string> <string name="msg_ble_connect_success">It is now connected to the %1$s.Operate the %1$s.</string>
<string name="select_spp_device_title">Serial communication device selection</string> <string name="select_spp_device_title">Serial communication device selection</string>
<string name="msg_get_device_token_fail">Failed to acquire the device token required for the push notification service. \nCheck if the GooglePlayService app is installed.</string>
</resources> </resources>
package jp.agentec.abook.abv.ui.common.activity; package jp.agentec.abook.abv.ui.common.activity;
import android.content.DialogInterface;
import android.widget.Toast; import android.widget.Toast;
import jp.agentec.abook.abv.bl.acms.type.LoginStatus;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback; import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.log.LogLevel; import jp.agentec.abook.abv.bl.common.log.LogLevel;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
...@@ -11,6 +14,7 @@ import jp.agentec.abook.abv.cl.environment.DeviceInfo; ...@@ -11,6 +14,7 @@ import jp.agentec.abook.abv.cl.environment.DeviceInfo;
import jp.agentec.abook.abv.cl.push.FcmManager; import jp.agentec.abook.abv.cl.push.FcmManager;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil; import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
/** /**
* Login処理の共通ロジックを実装する * Login処理の共通ロジックを実装する
...@@ -29,22 +33,27 @@ public abstract class ABVLoginActivity extends ABVNoAuthenticatedActivity { ...@@ -29,22 +33,27 @@ public abstract class ABVLoginActivity extends ABVNoAuthenticatedActivity {
@Override @Override
public Object callback(Object ret) { public Object callback(Object ret) {
String fcmToken = (String)ret; String fcmToken = (String)ret;
try {
if (fcmToken == null) { if (fcmToken == null) {
Logger.w(TAG, "[fcmRegister]: FCM Token is null."); Logger.w(TAG, "[fcmRegister]: FCM Token is null.");
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
ABVToastUtil.showMakeText(ABVLoginActivity.this, R.string.fcm_not_supported, Toast.LENGTH_SHORT); AlertDialogUtil.showAlertDialog(ABVLoginActivity.this, R.string.app_name, R.string.msg_get_device_token_fail, true, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
// FCMトークンを取得できない場合、noneIdでセットしてログインする
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
serverLoginAndCheckChangeUser("noneId");
}
});
} }
}); });
// FCMトークンを取得できない場合、noneIdでセットしてログインする
fcmToken = "noneId";
} }
});
} else {
serverLoginAndCheckChangeUser(fcmToken); serverLoginAndCheckChangeUser(fcmToken);
} finally {
closeProgressPopup();
} }
return null; return null;
} }
......
...@@ -555,6 +555,8 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -555,6 +555,8 @@ public class LoginActivity extends ABVLoginActivity {
handingLoginABVException(e); handingLoginABVException(e);
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "", e); Logger.e(TAG, "", e);
} finally {
closeProgressPopup();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment