Пуш-уведомления RuStore в apk-webview: SDK, сервис приёма, канал
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
package ru.ua1zbe.bus127;
|
||||||
|
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
|
||||||
|
/** Открытие расписания по клику на уведомление. */
|
||||||
|
final class PushIntents {
|
||||||
|
|
||||||
|
private PushIntents() {
|
||||||
|
}
|
||||||
|
|
||||||
|
static PendingIntent web(Context context, String url) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||||
|
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
return PendingIntent.getActivity(context, 0, intent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user