我们只是将VOiP功能添加到我们的应用程序(消息传递应用程序),现在我们将使用VOiP(PushKit Framework).
任何人都可以告诉我,我们是否只能使用该通知(VOIP通知)?甚至对于文本消息的含义(例如,不是用于呼叫)?我谈到Apple Appstore Guides,他们可以拒绝该应用或阻止通知,如果他们发现我们使用该通知通知用户其他事情然后是VOIP呼叫?
我想在我的iOS应用程序中实现VoIP通知,但是didUpdatePushCredentials方法永远不会被调用,我无法获得设备令牌.
我在应用程序中实现了APNS,这两个服务可能会发生冲突吗?
这是我的AppDelegate代码
- (void)application:(UIApplication *)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
LOGI(@"%@", NSStringFromSelector(_cmd));
//register for voip notifications
self->pushRegistry = [[PKPushRegistry alloc] initWithQueue:dispatch_get_main_queue()];
[self->pushRegistry setDelegate:self];
[self->pushRegistry setDesiredPushTypes:[NSSet setWithObject:PKPushTypeVoIP]];
NSLog(@"VoIP push registered");
}
#pragma mark - VoIP push methods
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type {
NSLog(@"voip token: %@", credentials.token);
}
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {
NSDictionary *payloadDict = [payload.dictionaryPayload valueForKey:@"aps"];
NSString *message = (NSString *)[payloadDict valueForKey:@"alert"];
if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
UILocalNotification *localNotification = [[UILocalNotification alloc] …Run Code Online (Sandbox Code Playgroud) 我可以通过正常的推送通知和后端使用简单的node.js文件来获得基于令牌的新推送工作(不使用证书).
但是,我无法使用VoIP推送.我试过使用从PushKit派生的令牌 - creditials.token,但我总是得到400错误.
我似乎无法在网上找到任何信息.只是从WWDC提到基于令牌的auth也可以用于VoIP推送.
所以我有 VOIP 呼叫应用程序,一切正常。一个用户可以呼叫其他用户并可以通话。
但是我面临的问题是我不明白如何解决该问题。
当用户 1 呼叫用户 2 时,用户 1 向用户 2 发送 voip 推送请求。但是当收到推送通知时,用户 2 处于离线状态或未连接到互联网,之后当用户 2 返回在线 voip 推送时,一旦发送 voip 推送,我就会显示 callkit 界面,但此时用户 1 已经断开了通话。
那么如何识别voip推送是否过期推送
到目前为止我尝试过的
---> 我已经连接了套接字并向其他用户发送消息(从有效载荷接收的其他用户信息)之后,如果我没有收到来自 user1 的响应,我将等待 5 秒然后我没有显示 callkit 界面
---> 我已经尝试将 apns-expiration 设置为 0 但仍然推送交付
必须有像whatsapp这样的更好的方法来处理这个
请指导我
我正在寻找解决方案,但尚未找到任何解决方案。我的应用程序仅接收 VoIP 推送,在 iOS 13 之后,当应用程序处于后台模式时,我无法再接收推送。我查看了其他问题,但无法通过提出的解决方案解决我的问题。有人可以帮助我吗?
在 iOS 13.0 及更高版本上,必须在收到传入 IP 语音呼叫时以及在 didReceiceIncomingPush() 方法完成执行之前使用 CallKit 框架进行报告,否则系统将终止您的应用程序。
多次未能报告来电可能会导致您的应用无法接收更多来电通知。
基本上,您不能再使用 VoIP 推送来发送非 VoIP 消息,并且需要对这些消息使用常规推送通知。
我读了这个公告,但在我的应用程序中,对于特定类型的推送 VoIP,我无法使用函数reportNewIncomingCall(),因为它需要如下参数:uuid、handle、hasVideo ecc。并且这些参数不存在于有效负载中。
我仅在尝试使用 UserNotifications 框架注册远程通知时收到此错误。使用 PushKit 时一切正常。
dispatch_queue_t mainQueue = dispatch_get_main_queue();
// Create a push registry object
self.voipRegistry = [[PKPushRegistry alloc] initWithQueue: mainQueue];
// Set the registry's delegate to self
self.voipRegistry.delegate = self;
// Set the push type to VoIP
self.voipRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP];
Run Code Online (Sandbox Code Playgroud)
从 Xcode 11 和 iOS13 开始,PushKit 发生了变化以支持 CallKit,因此我尝试使用 UserNotifications 代替,如Apple 文档中所述
Important
If you are unable to support CallKit in your app, you cannot use PushKit to handle push notifications. Instead, configure your app's push notification support …Run Code Online (Sandbox Code Playgroud) objective-c apple-push-notifications ios pushkit usernotifications
因此,我正在开发一个IOS VOIP 应用程序,并发现我需要使用推送通知服务器来使我的应用程序在后台工作以接收来电等。
我搜索后没有找到任何关于如何设置、开发、使用、查找推送通知服务器/网关的信息
我找到了一些付费服务器,但对我没有任何帮助,因为我现在无法付款。
我很抱歉写了一个完全由文本组成的问题,没有代码,但现在没有代码可以使用。
是的,我阅读了文档、文章等,但他们只是谈论“设置你的服务器并向 apns 发送推送”,对于我应该使用什么或如何设置服务器没有任何有用的信息。
这是我已经发现的:
如何创建可以接收 VoIP 推送通知的本机 iOS 应用程序
如果不存在推送通知服务器/网关的非付费替代方案,是否可以通过最新的 IOS 更改来解决此问题?(我在这里找到了类似 Zoiper 团队所说的解决方法)
提前致谢!
[编辑]
解决方案是使用 Flexisip 代理服务器。
我正在关注这篇文章和M Penades建立VoIP通知演示的答案.我可以使用注册通知,didRegisterUserNotificationSettings并可以从中获取voip令牌didUpdatePushCredentials.
但是当我使用休斯顿模拟向我的设备发送通知时,我可以1 push notification sent successfully从控制台获取消息但在设备端没有操作或日志.似乎didReceiveIncomingPushWithPayload永远不会被调用.
PS我正在使用Xcode 7.3,iPhone 6(iOS 9.3)和iPad Mini(iOS 9.3)进行开发.分布式Ad Hoc ipa用于安装.
这里的代码发布了.
import UIKit
import PushKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
let voipRegistry = PKPushRegistry(queue: dispatch_get_main_queue())
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
//Enable all notification type. VoIP Notifications don't present a UI but we will use …Run Code Online (Sandbox Code Playgroud) 我正在使用CallKit和PushKit在Swift中开发软电话。在iOS 13之前,VoIP通知运行良好。但是,在iOS 13更新之后,我的应用程序在后台运行时没有收到VoIP推送通知。在前台didReceiveIncomingPushWith被调用,但在后台不被调用。
如何解决此问题?
码
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
print("\(#function)")
let voipPushResgistry = PKPushRegistry(queue: nil)
voipPushResgistry.delegate = self
voipPushResgistry.desiredPushTypes = [PKPushType.voIP]
return true
}
func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) {
print("\(#function) token invalidated")
}
func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, for type: PKPushType) {
let deviceToken = credentials.token.reduce("", {$0 + String(format: "%02X", $1) })
print("\(#function) token is: \(deviceToken)")
}
func …Run Code Online (Sandbox Code Playgroud) app的生命周期是什么?当app处于终止状态并且推送套件有效负载到来时.
首先,Pushkit委托方法将起作用或AppDelegate方法将起作用.
有人可以描述在这种情况下被调用的方法序列吗?
感谢你的回答.
提前致谢.
push-notification apple-push-notifications ios appdelegate pushkit
pushkit ×10
ios ×9
swift ×3
callkit ×2
objective-c ×2
appdelegate ×1
ios13 ×1
iphone ×1
voip ×1
xcode11 ×1