开发者

Another sound for a push notification

开发者 https://www.devze.com 2023-02-06 22:19 出处:网络
I am trying to send myself a remote notification with another sound than the default sound(tri-tone).

I am trying to send myself a remote notification with another sound than the default sound(tri-tone). But when I add "sound" : "chime", I'm not getting another sound?开发者_如何学Go

Can someone help me to put the Horn as notification sound?

Thanks in advance


I don't think its a big issue.You just need to download one wave file with the sound you like and add it in the the resource folder and code it accordingly.

- (id)init 
{
    self = [super init];
    if(self != nil) 
    {
        self.deviceToken1 = @"your token key";
        self.payload = @"{\"aps\":{\"alert\":\"You got a new message!\",\"badge\":5,\"sound\":\"beep.wav\"},\"acme1\":\"bar\",\"acme2\":42}";
        //  self.payload = @"{\"aps\":{\"alert\":\"This is some fany message.\",\"badge\":1}}";
        self.certificate = [[NSBundle mainBundle] pathForResource:@"certi_identity(2)" ofType:@"cer"];
    }
    return self;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消