私のアプリケーションにvoipプッシュサポートを追加します。私はlinkの手順に従った。 hustonからプッシュを送信すると、「1プッシュ通知が正常に送信されました」と表示されます。私はamazon snを使用して同じことを試みました。プッシュが正常に公開されたと同じですが、プッシュがレジストリの代理人、つまりdidReceiveIncomingPushWithPayloadで受信されていません。私はvoip配信プロファイルを使ってこれを試しました。 ご協力いただければ幸いです。iosデバイスでVoipプッシュを受信していません
0
A
答えて
1
0
リファレンス https://github.com/hasyapanchasara/PushKit_SilentPushNotification
オブジェクティブCとスウィフトコードの両方があります。
証明書、コードを確認し、voip(サイレント)プッシュ通知を送信するだけです。
import UIKit
import PushKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,PKPushRegistryDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let types: UIRemoteNotificationType = [.Alert, .Badge, .Sound]
application.registerForRemoteNotificationTypes(types)
self.PushKitRegistration()
return true
}
//MARK: - PushKitRegistration
func PushKitRegistration()
{
let mainQueue = dispatch_get_main_queue()
// Create a push registry object
if #available(iOS 8.0, *) {
let voipRegistry: PKPushRegistry = PKPushRegistry(queue: mainQueue)
// Set the registry's delegate to self
voipRegistry.delegate = self
// Set the push type to VoIP
voipRegistry.desiredPushTypes = [PKPushTypeVoIP]
} else {
// Fallback on earlier versions
}
}
@available(iOS 8.0, *)
func pushRegistry(registry: PKPushRegistry!, didUpdatePushCredentials credentials: PKPushCredentials!, forType type: String!) {
// Register VoIP push token (a property of PKPushCredentials) with server
let hexString : String = UnsafeBufferPointer<UInt8>(start: UnsafePointer(credentials.token.bytes),
count: credentials.token.length).map { String(format: "%02x", $0) }.joinWithSeparator("")
print(hexString)
}
@available(iOS 8.0, *)
func pushRegistry(registry: PKPushRegistry!, didReceiveIncomingPushWithPayload payload: PKPushPayload!, forType type: String!) {
// Process the received push
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
幸いコーディングしてください。
関連する問題
- 1. iOS Firebaseプッシュ通知は、objを使用してデバイスで受信しません。
- 2. iOSでプッシュ通知メッセージを受信していません
- 3. iOS CloudKitからプッシュ通知を受信していません
- 4. iOSでプッシュ通知を受信できませんか?
- 5. FCMプッシュ通知を受信できませんIOS - 目的C
- 6. Azure iOSプッシュ通知はプロダクションモードで受信できませんか?
- 7. のiOSのVoIPプッシュ -
- 8. FirebaseからiOSアプリケーションへのプッシュ通知を受信していません
- 9. DEBUGモードでプッシュ通知を受信していません
- 10. イオン3プッシュ通知は、iOS上で受信されません
- 11. iOS VOIPプッシュ通知の信頼性の高い配信
- 12. プッシュ通知、quickblox、androidを受信していません
- 13. iOS - APNS - プッシュ受信しない
- 14. PushKitを使用してVoIP通知を受信できません
- 15. iOSでローカルスケジュール通知を受信していません
- 16. iOS VoIPプッシュ通知(PushKit)
- 17. Azureプッシュ通知ハブはiOS PushKit VoIPプッシュ通知をサポートしていますか?
- 18. XamarinフォームiOSデバイスはUrban Airshipからプッシュを受け取りません
- 19. IOSがGCMプッシュ通知を受信していない
- 20. amazon snsを使用してGCMプッシュを受信していません
- 21. Firebaseプッシュ通知が受信されていません
- 22. Onesignalプッシュ通知が配信されますが、いずれのデバイスでも受信されません。
- 23. いくつかのデバイスでFirebaseクラウドメッセージングを受信していません
- 24. iOS 10デバイス、運用モードでの通知を受信していませんが、開発中です
- 25. Android UDP通信。デバイスからデータを受信できません
- 26. プッシュ通知は正常に送信されましたが、デバイスは受信しません(時々)
- 27. iOS Swift Appは、Parse Serverによって送信されたプッシュ通知を受信しません。
- 28. iOSデバイスへのプッシュ通知の送信
- 29. テレグラムアップデートを受信していません
- 30. ブロードキャストを受信していません
解決しましたか? – Hasya