簡體   English   中英

iOS在第三方應用中獲取Safari保存的信用卡信息

[英]iOS fetch Safari Saved Credit Card information in 3rd party apps

我最近一直在尋找safari保存的密碼,我參加了WWDC會議,詳細討論了如何從safari訪問保存的憑據並添加保存的憑據。

https://developer.apple.com/videos/play/wwdc2014-506/

http://devstreaming.apple.com/videos/wwdc/2014/506xxeo80e5kykp/506/506_ensuring_continuity_between_your_app_and_web_site.pdf

我也讀過這篇文章,發現這是從Safari中獲取保存憑據的代碼,

SecRequestSharedWebCredential(NULL, NULL, ^(CFArrayRef credentials, CFErrorRef error) {

    if (error != NULL) {
        // If an error occurs, handle the error here.
        [self handleError:error];
        return;
    }

    BOOL success = NO;
    CFStringRef server = NULL;
    CFStringRef userName = NULL;
    CFStringRef password = NULL;

    // If credentials are found, use them.
    if (CFArrayGetCount(credentials) > 0) {

        // There will only ever be one credential dictionary
        CFDictionaryRef credentialDict =
        CFArrayGetValueAtIndex(credentials, 0);

        server = CFDictionaryGetValue(credentialDict, kSecAttrServer);
        userName = CFDictionaryGetValue(credentialDict, kSecAttrAccount);
        password = CFDictionaryGetValue(credentialDict, kSecSharedPassword);

    }

});

很明顯,我們可以從safari訪問共享憑據,我看過應用程序執行這些操作,我還看到了本教程 ,詳細介紹了進行集成的步驟。

一直都很順利,現在我也看到你可以在safari中保存信用卡信息,它會自動幫助用戶在支付網站上預先填寫信用卡信息。

在此輸入圖像描述

在此輸入圖像描述

現在問題是,第三方應用程序可以獲取保存在safari中的已保存信用卡信息,反之亦然? 我做了很多谷歌搜索,它是點黑色,沒有完全匹配如何以編程方式這樣做。 有可能嗎?

假設您的應用程序有一個配套網站/后端,一個選項是使用Safari視圖控制器( SFSafariViewController )在您的網站上啟動“添加信用卡”頁面 - Safari視圖控制器可以訪問保存的信用卡信息(以及其他自動填充信息)。 用戶輸入新的信用卡后,您可以返回應用的主流程。

暫無
暫無

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

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