簡體   English   中英

iOS 手機應用程序:第三方應用程序集成,如 Viber/WhatsApp

[英]iOS phone app: third party app integration like Viber/WhatsApp

有一些 API 允許第三方應用程序在 iOS 原生手機應用程序中顯示為一個選項:

第三方集成

可以看到有 Viber 和 WhatsApp,選擇它會打開第三方應用程序。

這里使用的是哪個 API? 我不知道要搜索什么才能獲取有關如何將我的 voip 應用程序與本機 iPhone 應用程序集成的信息。 我想某種擴展。 非常感謝有關要搜索的關鍵字和任何示例的任何幫助。

以下是在本機應用程序中激活此選項的方法:

首先,必須使用 CallKit 框架。 iOS 將自動生成這些選項(稱為句柄)。 負責該財產是supportedHandleTypesCXHandleTypePhoneNumber手柄類型。

CXProviderConfiguration * config = [[CXProviderConfiguration alloc] initWithLocalizedName:NSLocalizedString(@"myAppName", @"")];
config.supportedHandleTypes = [NSSet setWithObjects:@(CXHandleTypePhoneNumber), nil];

調用此配置后,將出現本機應用程序中的句柄。 我在我的應用程序委托中調用了這個:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

如果視頻句柄也應該出現,那么配置應該是:

config.supportsVideo = YES;

還有另外兩種句柄類型CXHandleTypeGenericCXHandleTypeEmailAddress ,但我無法弄清楚這些句柄引起了什么變化。 如果您知道他們在做什么,請發表評論。

ps:我之前用的是CXHandleTypeGeneric ,我的應用程序看不到句柄。 一旦我將其更改為CXHandleTypePhoneNumber ,該句柄就會自動添加到聯系人詳細信息中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM