0

PushSharp でプッシュ通知にカスタム サウンドを追加しようとしていますが、これに関するドキュメントが見つかりません。私は C# で Windows サービスを使用していますが、すべてがデフォルトのサウンドで動作しました。しかし、このコードを使用すると、デフォルトのサウンドまたはサウンドなしのいずれかが得られます。

push.QueueNotification(new AppleNotification()                                        
     .ForDeviceToken(deviceToken)                          
     .WithAlert(FormatMatchesMessage(offers))                      
     .WithSound("Jingle.mp3"));

サウンド ファイルは C# プロジェクトに含まれており、iOS アプリ プロジェクトにも含まれています。

それを機能させるために何をする必要がありますか? それはファイルタイプに関するものですか?

4

1 に答える 1

0

PushSharp を使用したことはありませんが、Push 通知にサウンドを追加する通常の方法は、単純に完全なファイル名を指定することです。サウンド名が正しく、ファイルがアプリで利用可能ですか?

次のようなメソッドを呼び出して、サウンド付きのローカル プッシュ通知をスケジュールすることができます。

+(void)scheduleNotificationForDate:(NSDate*)date withMessage:(NSString*)message andOKButtonTitle:(NSString*)buttonTitle andPayLoad:(NSMutableDictionary*)dic andSoundName:(NSString*)soundName
{
    UILocalNotification *not =[[UILocalNotification alloc] init];
    not.fireDate = date;
    not.alertBody = message;
    not.alertAction = buttonTitle;
    not.soundName = soundName; 
    [[UIApplication sharedApplication] scheduleLocalNotification:not];
}
于 2013-08-20T09:07:16.573 に答える