关于极光推送消息提醒并且播放指定铃声

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/s261676224/article/details/77062088
private static PushPayload PushPayload_all(string[] all, string conetent, string Url, string sound)
        {
            PushPayload pushPayload = new PushPayload();
            pushPayload.platform = Platform.all(); ;
            pushPayload.audience = Audience.all();
            var notification = new Notification();
            notification.IosNotification = new IosNotification().setAlert(conetent).setSound("callu.caf");
            notification.AndroidNotification = new AndroidNotification().setAlert(conetent);
            pushPayload.notification = notification;
            pushPayload.options.apns_production = true;
            pushPayload.message = Message.content(conetent).AddExtras("Act", "OpenWeb").AddExtras("Url", "/" + Url).AddExtras("Sound", sound);
            return pushPayload;
	}

注意IOS和Android系统的配置区别

ios中:须通过setSound()来配置,而Android中直接可以扩展参数来设置

简要介绍如下:

猜你喜欢

转载自blog.csdn.net/s261676224/article/details/77062088
今日推荐