我正在尝试使用 Firebase 和 pyfcm https://pypi.python.org/pypi/pyfcm/发送推送通知 。但我想知道如何发送带有通知的图像,因为在参数中搜索没有选项
这是pyfcm的文档代码:
def notify_multiple_devices(self,
registration_ids=None,
message_body=None,
message_title=None,
message_icon=None,
sound=None,
condition=None,
collapse_key=None,
delay_while_idle=False,
time_to_live=None,
restricted_package_name=None,
low_priority=False,
dry_run=False,
data_message=None,
click_action=None,
badge=None,
color=None,
tag=None,
body_loc_key=None,
body_loc_args=None,
title_loc_key=None,
title_loc_args=None,
content_available=None,
extra_kwargs={}):
Run Code Online (Sandbox Code Playgroud)
那么我应该使用哪个参数来发送 url 图像?
谢谢
我制作应用程序,您可以在其中设置闹钟.例如,我星期一早上7点钟上课,所以我需要每周一开始报警,但周二还有另一节课,必须这样做.
我已经可以做到这一点并且工作,每个curso发出警报,但是当我重新启动手机时,它们就无法工作.
这是我的代码,put extra在我的应用程序中非常重要:
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis());
cal.set(Calendar.HOUR_OF_DAY, horai);
cal.set(Calendar.MINUTE, minutoi);
cal.set(Calendar.DAY_OF_WEEK, dias.getSelectedItemPosition() + 1);
cal.add(Calendar.SECOND, 2);
Intent intent = new Intent(getBaseContext(), AlarmReceiver.class);
intent.putExtra("name", curso);
//intent.putExtra("curos bn",1);
PendingIntent pendingIntent =
PendingIntent.getBroadcast(getBaseContext(),
cont, intent, PendingIntent.FLAG_UPDATE_CURRENT );//cont star with 1 a then ++
Run Code Online (Sandbox Code Playgroud)
接收器
public class AlarmReceiver extends BroadcastReceiver {
private static final String TAG = "BANANEALARM";
Intent intent;
PendingIntent pendingIntent;
NotificationManager notificationManager;
private static final int PERIOD=5000;
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "BroadcastReceiver has received …Run Code Online (Sandbox Code Playgroud)