Finished the tusky-api server.

This commit is contained in:
Vavassor 2017-03-14 18:39:32 -04:00
parent 5e93e5d99c
commit 5d68c6df8f
3 changed files with 8 additions and 7 deletions

View file

@ -177,12 +177,12 @@ public class MainActivity extends BaseActivity {
tuskyAPI.register(getBaseUrl(), getAccessToken(), FirebaseInstanceId.getInstance().getToken()).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
Log.d(TAG, "tusky-api reponse: " + response.message());
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
Log.d(TAG, "tusky-api failure: " + t.getMessage());
}
});
}

View file

@ -13,6 +13,7 @@ import retrofit2.Response;
import retrofit2.Retrofit;
public class MyFirebaseInstanceIdService extends FirebaseInstanceIdService {
private static final String TAG = "MyFirebaseInstanceIdService";
private TuskyAPI tuskyAPI;
@ -37,23 +38,23 @@ public class MyFirebaseInstanceIdService extends FirebaseInstanceIdService {
tuskyAPI.unregister("https://" + domain, accessToken).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
Log.d(TAG, response.message());
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
Log.d(TAG, t.getMessage());
}
});
tuskyAPI.register("https://" + domain, accessToken, refreshedToken).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
Log.d(TAG, response.message());
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
Log.d(TAG, t.getMessage());
}
});
}

View file

@ -129,7 +129,7 @@
<string name="search">Search accounts…</string>
<string name="toggle_nsfw">NSFW</string>
<string name="action_mention">Mention</string>
<string name="tusky_api_url">http://tuskynotify.keylesspalace.com</string>
<string name="tusky_api_url">https://tuskynotifier.keylesspalace.com</string>
<string name="notification_mention_format">%s mentioned you</string>
</resources>