来自推进器/横梁的推送通知不会出现在emu中

2024-05-18 14:21:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我为我的android应用程序设置了一个Pusher/Beams帐户,但是当我执行脚本发送通知时,它在运行我的应用程序的android studios模拟器上没有显示出来。 安卓工作室代码:

import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

import com.pusher.pushnotifications.PushNotifications;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        PushNotifications.start(getApplicationContext(), "instance_id");
        PushNotifications.subscribe("hello");
    }
}

发送通知的Python脚本: 从pusher_push_notifications导入PushNotifications

^{pr2}$

Tags: import脚本应用程序帐户模拟器androidbundlepusher

热门问题