1. 程式人生 > >關於極光推送訊息提醒並且播放指定鈴聲

關於極光推送訊息提醒並且播放指定鈴聲

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中直接可以擴充套件引數來設定

簡要介紹如下: