Я хочу добавить поддержку voip push для моего приложения. Я выполнил шаги в link. При отправке push из huston говорится: «1 push-уведомление отправлено успешно». Я попробовал то же самое, используя amazon sns, он говорит то же самое, что push успешно опубликован, но я не вижу, чтобы push был получен в делегате реестра, то есть didReceiveIncomingPushWithPayload. Я попробовал это, используя профиль распространения voip. Любая помощь будет оценена по достоинству.Voip push не получен в устройстве ios
0
A
ответ
1
Here является одной ссылкой для выполнения шагов VOIP.
Когда вы получите уведомление о voip, тогда didReceiveIncomingPushWithPayload get invoke. Вы можете уведомить пользователя с местным уведомлением оттуда.
+0
спасибо за ответ, я попробовал распечатать журнал, но он не работал. Но при добавлении локального уведомления я вижу, что он работает. – devdev
0
Справочник https://github.com/hasyapanchasara/PushKit_SilentPushNotification
И цель C и Swift код там.
Просто проверьте сертификаты, код и отправьте voip (silent) pushnotification.
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. APNS Push не получен
- 2. IOS VoIP Push - Не удалось зарегистрировать
- 3. VoIP Push-уведомления в Ionic для iOS
- 4. Приложение IOS voip с комплектом Push
- 5. iOS APN не получен
- 6. VoIP Push Notification from Parse
- 7. iOS Push Notification, не полученное на устройстве
- 8. VoIP Push не работает для демонстрации SDK для iOS
- 9. gcm не получен на устройстве sometime
- 10. Push успешно отправлен с использованием JAVAPNS, но не получен в клиентском устройстве
- 11. Добавить знак, если push получен в Swift
- 12. Paypal Transaction (Push-уведомление на устройстве iOS)
- 13. Voip push-уведомление внезапно перестает работать
- 14. Получение уведомлений VoIP PushKit iOS
- 15. Push не получен, когда приложение убито
- 16. PushKit: Можем ли мы использовать push-набор (VoiP Push) в приложении чата без использования VoiP
- 17. VoIP-мелодия не работает
- 18. Сертификат VoIP-услуг iOS
- 19. iOS App с VoIP
- 20. IOS Push-уведомления не работает на моем устройстве
- 21. Вспомните предыдущее отправленное push-уведомление на iOS
- 22. iOS 8 Push-уведомление не работает на реальном устройстве
- 23. Push используя Parse SDK для IOS не поставляются на устройстве
- 24. Push-уведомление не получено в устройстве ios5
- 25. Интеграция вызовов VOIP в ios
- 26. Разбор получен GCM-сообщение в push-уведомление
- 27. Ionic Push - не получает токен на устройстве
- 28. Представить все VOIP приложения на устройстве пользователя
- 29. GCM push не получен на устройстве с модулями Postman или Node
- 30. iOS Push уведомление Не работает
Решено ли это? – Hasya