2017-10-02 5 views
0

私は、iOSアプリケーションと関連するWebサイトとの間で資格情報を共有することについてかなり基本的なXamarin.iOSコードを実装しようとしています。Xamarin.iOS:「認識されないセレクタ」でSecurity.SecSharedCredential.RequestSharedWebCredentialがクラッシュする

public void TryGetSharedCredential(Action<Tuple<string, string>> callback) 
     { 
      try 
      { 
       Security.SecSharedCredential.RequestSharedWebCredential("www.jg.com", "[email protected]", (accounts, err) => 
       { 
        if (accounts != null && accounts.Any()) 
        { 
         var email = accounts[0]; 
         var password = accounts[1]; 

         callback(new Tuple<string, string>(email, password));  
        } 
       }); 
      } 
      catch (Exception ex) 
      { 
     //log exception 
      } 

      callback(null); 
     } 

ただし、次のログとRequestSharedWebCredentialクラッシュ(と決してNSActionに入ります)。

2017-10-02 16:33:30.083 JGMobileIOS[65076:4639965] -[__NSCFDictionary UTF8String]: unrecognized selector sent to instance 0x608000282f40 
2017-10-02 16:33:30.091 JGMobileIOS[65076:4639965] Xamarin.iOS: Received unhandled ObjectiveC exception: NSInvalidArgumentException -[__NSCFDictionary UTF8String]: unrecognized selector sent to instance 0x608000282f40 
2017-10-02 16:33:34.363 JGMobileIOS[65076:4640005] critical: Stacktrace: 

2017-10-02 16:33:34.364 JGMobileIOS[65076:4640005] critical: 
Native stacktrace: 

2017-10-02 16:33:34.365 JGMobileIOS[65076:4640005] critical: 0 JGMobileIOS       0x0000000104938004 mono_handle_native_crash + 244 
2017-10-02 16:33:34.366 JGMobileIOS[65076:4640005] critical: 1 JGMobileIOS       0x0000000104945970 mono_sigsegv_signal_handler + 288 
2017-10-02 16:33:34.366 JGMobileIOS[65076:4640005] critical: 2 libsystem_platform.dylib   0x000000011151db3a _sigtramp + 26 
2017-10-02 16:33:34.366 JGMobileIOS[65076:4640005] critical: 3 ???         0x0000000000000000 0x0 + 0 
2017-10-02 16:33:34.366 JGMobileIOS[65076:4640005] critical: 4 JGMobileIOS       0x00000001049988bc mono_debug_symfile_lookup_method + 44 
2017-10-02 16:33:34.366 JGMobileIOS[65076:4640005] critical: 5 JGMobileIOS       0x00000001049fc87d lookup_method_func + 61 
2017-10-02 16:33:34.367 JGMobileIOS[65076:4640005] critical: 6 JGMobileIOS       0x0000000104ad75bd monoeg_g_hash_table_foreach + 77 
2017-10-02 16:33:34.367 JGMobileIOS[65076:4640005] critical: 7 JGMobileIOS       0x00000001049fc2f9 mono_debug_lookup_method_async_debug_info + 105 
2017-10-02 16:33:34.367 JGMobileIOS[65076:4640005] critical: 8 JGMobileIOS       0x000000010489bfbb ss_start + 331 
2017-10-02 16:33:34.367 JGMobileIOS[65076:4640005] critical: 9 JGMobileIOS       0x0000000104897b16 debugger_thread + 27910 
2017-10-02 16:33:34.367 JGMobileIOS[65076:4640005] critical: 10 JGMobileIOS       0x0000000104a4b283 start_wrapper + 675 
2017-10-02 16:33:34.367 JGMobileIOS[65076:4640005] critical: 11 libsystem_pthread.dylib    0x000000011152f93b _pthread_body + 180 
2017-10-02 16:33:34.368 JGMobileIOS[65076:4640005] critical: 12 libsystem_pthread.dylib    0x000000011152f887 _pthread_body + 0 
2017-10-02 16:33:34.368 JGMobileIOS[65076:4640005] critical: 13 libsystem_pthread.dylib    0x000000011152f08d thread_start + 13 
2017-10-02 16:33:34.368 JGMobileIOS[65076:4640005] critical: 
================================================================= 
Got a SIGSEGV while executing native code. This usually indicates 
a fatal error in the mono runtime or one of the native libraries 
used by your application. 
================================================================= 

私が試してみました:任意のリンク(「リンクしない」)がなければ、シミュレータとデバイス

    • はまた、ドメインとアカウントを指定していないのオーバーロードを試してみました。ドキュメントによれば、ヌルドメインを渡すと、 Entitlements.plistで指定されたドメインがチェックされます。また、ヌルアカウントを指定した場合、 は、そのドメインのすべてのストアドアカウントが返されます。 同じクラッシュ。

    私がチェックしていentitlements.plist:httpsの上(www.jg.com/.well-known/apple-app-site-association:

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.developer.associated-domains</key> <array> <string>applinks:www.jg.com</string> <string>webcredentials:www.jg.com</string> </array> </dict> </plist>

    私は、正しいJSONを持っています)

    { 
        "applinks": { 
        //applink stuff 
        }, 
        "webcredentials": { 
        "apps": [ 
        //full teamid + appid 
        ] 
        } 
    } 
    

    私は何かが次Xamarinの下に間違って起こっていると考えている - > iOSのAPIメソッドマッピング:

    public static void AddSharedWebCredential (string domainName, string account, string password, Action<NSError> handler); 
    
        public static string CreateSharedWebCredentialPassword(); 
    
        public static void RequestSharedWebCredential (string domainName, string account, Action<string[], NSError> handler); 
    
        [Introduced (PlatformName.iOS, 8, 0, PlatformArchitecture.None, null)] 
        [DllImport ("/System/Library/Frameworks/Security.framework/Security")] 
        private static extern void SecAddSharedWebCredential (IntPtr fqdn, IntPtr account, IntPtr password, IntPtr completionHandler); 
    
        [Introduced (PlatformName.iOS, 8, 0, PlatformArchitecture.None, null)] 
        [DllImport ("/System/Library/Frameworks/Security.framework/Security")] 
        private static extern IntPtr SecCreateSharedWebCredentialPassword(); 
    
        [Introduced (PlatformName.iOS, 8, 0, PlatformArchitecture.None, null)] 
        [DllImport ("/System/Library/Frameworks/Security.framework/Security")] 
        private static extern void SecRequestSharedWebCredential (IntPtr fqdn, IntPtr account, IntPtr completionHandler); 
    

    何がうまくいかないのかについてもっと詳しく知りたいのですが?私は何かが欠落していますか、他に何を試すことができますか?

    https://bugzilla.xamarin.com/show_bug.cgi?id=60423

    修正はここにコミット:

  • 答えて

    関連する問題