Xamarin 绑定到 objC 支付 api 总是从 api 返回超时
Posted
技术标签:
【中文标题】Xamarin 绑定到 objC 支付 api 总是从 api 返回超时【英文标题】:Xamarin binding to objC payment api always returns timeout from api 【发布时间】:2014-09-23 05:31:37 【问题描述】:您好,我们创建了一个 Xamarin 绑定到 objC 支付 api。在我们使用 ios SDK 6.1 之前,此绑定项目运行良好,现在它在 iOS SDK 7.1 中中断,并且总是从 api 返回超时。
Sep 22 08:13:08 Xamarin-Team-Test-Device-5S Sample[681] : activationUrl in use : https://******************************************
Sep 22 08:13:11 Xamarin-Team-Test-Device-5S Sample[681] : ----->Called initiate Session
Sep 22 08:13:11 Xamarin-Team-Test-Device-5S Sample[681] : parameters used
Sep 22 08:13:11 Xamarin-Team-Test-Device-5S Sample[681] : Key - DF12 & Value - ******
Sep 22 08:13:11 Xamarin-Team-Test-Device-5S Sample[681] : Key - DF11 & Value - ******
Sep 22 08:13:20 Xamarin-Team-Test-Device-5S syncdefaultsd[686] : (Note ) SYDAccount: no account
Sep 22 08:13:20 Xamarin-Team-Test-Device-5S syncdefaultsd[686] : (Note ) SYDPIMAccount: no account (null)
Sep 22 08:13:20 Xamarin-Team-Test-Device-5S syncdefaultsd[686] : (Note ) SYDAlwaysOnAccount: no account (null)
Sep 22 08:13:53 Xamarin-Team-Test-Device-5S backboardd[31] : ALS: SetDisplayFactor: factor=0.0500
Sep 22 08:13:55 Xamarin-Team-Test-Device-5S backboardd[31] : ALS: SetDisplayFactor: factor=1.0000
Sep 22 08:13:57 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084437.123934]: Client MobileMail set type to normal application
Sep 22 08:13:57 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084437.124622]: BG Application: Not Present, BG Daemon: Present. Daemons: sharingd apsd networkd
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.721643]: WiFiLocaleManagerCheckLocale: trying to determine locale...
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.722217]: WiFiManagerCoreLocationGetCachedLocation: getting cached location...
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.726062]: __WiFiLocaleManagerGetLocaleFromMcc: finding iso country code for mcc 404 ....
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.726653]: Starting Low Accuracy Location Monitoring, locationMonitoringTimeout=60.000000
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.727160]: WiFiManagerCoreLocationStartLocationUpdates: starting location updates...
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.727587]: Location Monitoring successfully started with accuracy=3000.000000meters
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.728692]: __WiFiLocationServiceManagerEventCallback, got cb dict
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : eventType : 0
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : location : <+17.44007333,+78.37926585> +/- 86.49m (speed -1.00 mps / course -1.00) @ 9/22/14, 8:12:55 AM Central Daylight Time
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] :
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.733194]: __WiFiLocationServiceManagerProcessLocationAvailableEvent: isValidHighAccuracyLocation 1, isValidLowAccuracyLocation 1
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.733642]: __WiFiLocationServiceManagerProcessLocationAvailableEvent: give low accuracy callback
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.734005]: __WiFiLocaleManagerGetLocaleFromLocation: <+17.44007333,+78.37926585> +/- 86.49m (speed -1.00 mps / course -1.00) @ 9/22/14, 8:12:55 AM Central Daylight Time
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.737186]: locale from bounding box Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.737526]: new locale: , locale:
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.737866]: Stopping Low Accuracy Location Monitoring
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.738215]: Location Monitoring stopped
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.738544]: WiFiManagerCoreLocationStopLocationUpdates: stopping location updates...
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.740562]: Stopping Low Accuracy Location Monitoring
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.740988]: CLMonitoring is already stopped
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.749325]: Async scan requested by "locationd" for 1 iterations with maxage=0 priority normal on en0
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.749694]: Enqueuing command type: "Scan" pending commands: 0
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.749988]: Dequeuing command type: "Scan" pending commands: 0
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.750235]: Attempting Apple80211ScanAsync on en0
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.791170]: WiFi unquiescing requested by "locationd"
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.797443]: WiFi unquiescing requested by "locationd"
Sep 22 08:14:07 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084447.999343]: Completed Apple80211ScanAsync on en0 (0)
Sep 22 08:14:08 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084448.001306]: Async scan request completed for "locationd" (0)
Sep 22 08:14:08 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084448.007309]: Async scan requested by "locationd" for 1 iterations with maxage=0 priority normal on en0
Sep 22 08:14:08 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084448.007845]: Enqueuing command type: "Scan" pending commands: 0
Sep 22 08:14:08 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084448.008259]: Dequeuing command type: "Scan" pending commands: 0
Sep 22 08:14:08 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084448.008624]: Attempting Apple80211ScanAsync on en0
Sep 22 08:14:08 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084448.484228]: Completed Apple80211ScanAsync on en0 (0)
Sep 22 08:14:08 Xamarin-Team-Test-Device-5S wifid[40] : WiFi:[433084448.485499]: Async scan request completed for "locationd" (0)
Sep 22 08:14:11 Xamarin-Team-Test-Device-5S Sample[681] : output parameters
Sep 22 08:14:11 Xamarin-Team-Test-Device-5S Sample[681] : Key - DF39 & Value - 4900
Sep 22 08:14:11 Xamarin-Team-Test-Device-5S Sample[681] : ----->DONE initiate Session
Sep 22 08:14:11 Xamarin-Team-Test-Device-5S backboardd[31] : HID: The 'Rate Controlled' connection 'Sample' access to protected services is denied.
【问题讨论】:
任何人都可以解释 HID:“速率控制”连接“示例”对受保护服务的访问被拒绝。 你能贴一些代码吗?这是在设备上还是模拟器上?您更新 Xcode 和 iOS SDK 是造成这种情况的主要原因吗? 是的,我更新了 Xcode 和 xamarin。 HID:“速率控制”连接“示例”对受保护服务的访问被拒绝错误不是因为 xamarin 绑定到 objc。一旦我在它开始工作的单独线程中执行此操作,我就使用了 api 的主线程。 【参考方案1】:一旦我在它开始工作的单独线程中执行此操作,我就使用了 api 的主线程。我需要弄清楚新线程是如何使它工作的。
【讨论】:
以上是关于Xamarin 绑定到 objC 支付 api 总是从 api 返回超时的主要内容,如果未能解决你的问题,请参考以下文章
XAML WebView绑定到不在Xamarin Forms中的字符串
Xamarin:Java 绑定项目 - 无法更改本地界面的可见性
AppsFlyer Xamarin iOS 绑定,空引用异常
Xamarin TouchRunner挂起呼叫IOS第三方绑定
合同主体列表添加两条合同主体,返回合并支付页面,支付总弹"请选择合同主体",删除后,竟然还能支付(改合并支付页面的字段状态)