ios 使用linhacks sdk推送通知

wixjitnu  于 11个月前  发布在  iOS
关注(0)|答案(1)|浏览(130)

我想为我的应用程序启用推送通知,以便在调用期间(或关闭时)从后台“提升”应用程序,但这不再那么重要),我在Core遇到了这个mCore.pushNotificationEnabled属性,并有问题:
1.如果我这样做mCore.pushNotifications Enabled = true那么我不需要在AppDelegate中写我的PushRegistry?还有什么要添加的吗?
1.如果你从sdk创建者那里下载linphone-ios项目,在这个链接https://gitlab.linphone.org/BC/public/linhome-ios,那么你可以通过搜索xcode找到这样一个函数->

/// Callback prototype for notifying the application a push notification was
/// received. 
/// On iOS it only works with pushkit (VoIP) pushes. 
/// - Parameter core: LinphoneCore object    
/// - Parameter payload: the body of the push notification, if any    
func onPushNotificationReceived(core: Core, payload: String)

字符串
但在我的项目中,我不太明白如何调用它,因为即使是xcode也无法通过搜索找到它
1.如果你仍然不能写PushRegistry,那么从第二点开始,函数的有效负载应该是什么?它必须包含注册数据或其他沿着的东西吗?

t2a7ltrp

t2a7ltrp1#

如果我这样做mCore. pushRegistry Enabled = true,那么我不需要在AppDelegate中写入我的PushRegistry?
根据https://wiki.linphone.org/xwiki/wiki/public/view/Lib/Features/Push%20notifications/,你确实不需要写PushRegistry。
func onPushNotificationReceived(core:Core,payload:String)
这是一个来自CoreDelegate的委托。这意味着您可以在Core上添加一个委托,以监听应用中的推送。
也许你可以从iOS教程中受益,特别是与push notifications相关的教程。

相关问题