アプリ設定に「アクセストークンをアプリサーバに送信する」を追加
This commit is contained in:
parent
2b824c3431
commit
05bc5ce016
|
@ -12,8 +12,8 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
|
||||
versionCode 232
|
||||
versionName "2.3.2"
|
||||
versionCode 233
|
||||
versionName "2.3.3"
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
|
|
@ -193,6 +193,12 @@ class ActCustomStreamListener : AppCompatActivity(), View.OnClickListener, TextW
|
|||
try {
|
||||
|
||||
while(true) {
|
||||
|
||||
if( ! Pref.bpSendAccessTokenToAppServer(Pref.pref(this@ActCustomStreamListener))){
|
||||
addLog("we won't use push notification until 'SendAccessTokenToAppServer' is not set.")
|
||||
break
|
||||
}
|
||||
|
||||
if(strSecret.isEmpty()) {
|
||||
addLog("Secret is empty. Custom Listener is not used.")
|
||||
break
|
||||
|
|
|
@ -1149,9 +1149,14 @@ class PollingWorker private constructor(c : Context) {
|
|||
|
||||
}
|
||||
|
||||
// 定期的な通知更新が不要なら真を返す
|
||||
private fun registerDeviceToken() {
|
||||
try {
|
||||
// 設定によってはデバイストークンやアクセストークンを送信しない
|
||||
if( ! Pref.bpSendAccessTokenToAppServer(Pref.pref(context))){
|
||||
log.d("registerDeviceToken: SendAccessTokenToAppServer is not set.")
|
||||
return
|
||||
}
|
||||
|
||||
// ネットワーク的な事情でインストールIDを取得できなかったのなら、何もしない
|
||||
val install_id = job.install_id
|
||||
if(install_id?.isEmpty() != false) {
|
||||
|
|
|
@ -301,6 +301,12 @@ object Pref {
|
|||
)
|
||||
|
||||
|
||||
val bpSendAccessTokenToAppServer = BooleanPref(
|
||||
"SendAccessTokenToAppServer",
|
||||
false,
|
||||
R.id.swSendAccessTokenToAppServer
|
||||
)
|
||||
|
||||
// int
|
||||
|
||||
val ipBackButtonAction = IntPref("back_button_action", 0)
|
||||
|
|
|
@ -115,6 +115,29 @@
|
|||
|
||||
<View style="@style/setting_divider"/>
|
||||
|
||||
<TextView
|
||||
style="@style/setting_row_label"
|
||||
android:text="@string/send_access_token_to_app_server"
|
||||
/>
|
||||
|
||||
<LinearLayout style="@style/setting_row_form">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/swSendAccessTokenToAppServer"
|
||||
style="@style/setting_horizontal_stretch"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout style="@style/setting_row_form">
|
||||
|
||||
<TextView
|
||||
style="@style/setting_horizontal_stretch"
|
||||
android:text="@string/send_access_token_to_app_server_desc"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<View style="@style/setting_divider"/>
|
||||
|
||||
<!-- =============================================== -->
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -630,6 +630,10 @@
|
|||
<string name="changed">changed.</string>
|
||||
<string name="thumbnails_arrange_vertically">Vertical arrange thumbnails (app restart required)</string>
|
||||
<string name="instance_local">Instance local</string>
|
||||
<string name="send_access_token_to_app_server">Send access token to app server</string>
|
||||
<string name="send_access_token_to_app_server_desc">Normally you can use "pull" notification (with delay) without app server, because it works on your device.
|
||||
\nBut if you want to use "custom notification listener", or if you are the member of very limited instances that is supported by ST\'s app server,
|
||||
\nyou can use "push" notifications, but you have to allow sending access tokens to the app server. (this is mastodon's defect)</string>
|
||||
|
||||
<!--<string name="abc_action_bar_home_description">Revenir à l\'accueil</string>-->
|
||||
<!--<string name="abc_action_bar_home_description_format">%1$s, %2$s</string>-->
|
||||
|
|
|
@ -912,5 +912,6 @@
|
|||
<string name="changed">変更しました</string>
|
||||
<string name="thumbnails_arrange_vertically">サムネイルを縦に並べる (アプリ再起動が必要)</string>
|
||||
<string name="instance_local">インスタンス内のみ</string>
|
||||
|
||||
<string name="send_access_token_to_app_server">アクセストークンをアプリサーバに送信する</string>
|
||||
<string name="send_access_token_to_app_server_desc">通常は"pull"通知(すこし遅れる)を利用できます。それは端末上で動作するのでアプリサーバは必要ありません。しかしカスタム通知リスナを使う場合やSTがサポートする限られたインスタンスのユーザである場合は"push"通知を利用することができます。ただしアクセストークンをアプリサーバに送信する必要があります(これはマストドンの欠陥です)。</string>
|
||||
</resources>
|
||||
|
|
|
@ -615,6 +615,10 @@
|
|||
<string name="fav_muted_user">FBN disabled users</string>
|
||||
<string name="fav_muted_user_long">Fav/Boost notification disabled users</string>
|
||||
<string name="changed">changed.</string>
|
||||
<string name="thumbnails_arrange_vertically">Vertical arrange thumbnails (app restart required)</string>
|
||||
<string name="thumbnails_arrange_vertically">Vertical arrange thumbnails (app restart required)</string>
|
||||
<string name="instance_local">Instance local</string>
|
||||
<string name="send_access_token_to_app_server">Send access token to app server</string>
|
||||
<string name="send_access_token_to_app_server_desc">Normally you can use "pull" notification (with delay) without app server, because it works on your device.
|
||||
\nBut if you want to use "custom notification listener", or if you are the member of very limited instances that is supported by ST\'s app server,
|
||||
\nyou can use "push" notifications, but you have to allow sending access tokens to the app server. (this is mastodon's defect)</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue