相关疑难解决方法(0)

Android WebView推送通知?

我需要通过android webview 发送通知(不一定是推送通知).我看到它Notification APIMDN上的Android Webview不兼容.我看到的其他API似乎是基于window.notification.

有没有人知道通过android webview发送通知的任何API或JS?

我从6个月前看过这篇文章,基本没有任何活动,只是模糊地提到了火柱.这会有帮助吗?

谢谢你的回答!

html javascript android android-webview

8
推荐指数
2
解决办法
1279
查看次数

使用WebView进行Android推送通知?

我按照本教程创建了一个推送通知应用程序:http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html

它工作正常,花花公子,当我收到通知时,我可以打开一个网站.但是,我能够将webview布局与此推送通知应用程序结合起来吗?我觉得它必须是可能的,因为电子邮件通知以这种方式工作.

这是我的代码处理我收到的通知:

    private void handleData(Context context, Intent intent) {
    String app_name = (String)context.getText(R.string.app_name);
    String message =  intent.getStringExtra("message");

    // Use the Notification manager to send notification
    NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    // Create a notification using android stat_notify_chat icon. 
    Notification notification = new Notification(android.R.drawable.stat_notify_chat, app_name + ": " + message, 0);

    // Create a pending intent to call the webviewactivity when the notification is clicked
    PendingIntent pendingIntent = PendingIntent.getActivity(context, -1, new Intent(context, webviewactivity.class), PendingIntent.FLAG_UPDATE_CURRENT); // 
    notification.when = …
Run Code Online (Sandbox Code Playgroud)

android push-notification android-webview

6
推荐指数
1
解决办法
3万
查看次数