[英]Uber Widget Login screen showing blank in iPhone but showing in simulator
我正在嘗試將Uber窗口小部件集成到我的iPhone應用程序(使用語言Objective C
在Xcode Version 7.3.1
)中。 按照Uber-ride-request-widget和Uber rides-ios-sdk的Github中所述放置所有內容。 在Uber開發人員帳戶中創建了Uber所需的所有憑證,例如CLIENT_ID
, Service Token
。 正如他們所說,我已經為Uber安裝了pod:
use_frameworks!
target 'My_Project_Name' do
pod 'UberRides'
end
並運行pod install
並成功安裝pod
,然后
按照他們的描述設置info.plist
:
<key>UberClientID</key>
<string>MY_APP_CLIENT_ID</string>
<key>UberDisplayName</key>
<string>MY_APP_NAME</string>
和
<key>UberCallbackURIs</key>
<array>
<dict>
<key>URIString</key>
<string>https://www.google.com</string>
<key>UberCallbackURIType</key>
<string>General</string>
</dict>
</array>
並且還添加以下代碼NSExceptionDomains
內NSAppTransportSecurity
保持NSAllowsArbitraryLoads
到true
<key>uber</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>uberauth</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
現在添加以下代碼didFinishLaunchingWithOptions
中AppDelegate
// China based apps should specify the region
[UBSDKConfiguration setRegion:RegionDefault];
// If true, all requests will hit the sandbox, useful for testing
[UBSDKConfiguration setSandboxEnabled:YES];
// If true, Native login will try and fallback to using Authorization Code Grant login (for privileged scopes). Otherwise will redirect to App store
[UBSDKConfiguration setFallbackEnabled:NO];
並編寫以下代碼來調用Uber Widget:
id<UBSDKRideRequesting> behavior = [[UBSDKRideRequestViewRequestingBehavior alloc] initWithPresentingViewController: self];
CLLocation *location4 = [[CLLocation alloc] initWithLatitude: 40.785695 longitude: -73.970208];
CLLocation *location2 = [[CLLocation alloc] initWithLatitude: 40.791251 longitude: -73.977149];
UBSDKRideParametersBuilder *builder = [[UBSDKRideParametersBuilder alloc] init];
[builder setPickupLocation:location4];
[builder setDropoffLocation:location2];
UBSDKRideParameters *parameters = [builder build];
UBSDKRideRequestButton *button1 = [[UBSDKRideRequestButton alloc] initWithRideParameters: parameters requestingBehavior: behavior];
button1.center=self.view.center;
[self.view addSubview:button1];
現在,當我在Simulator[Version 9.3 (SimulatorApp-645.9 CoreSimulator-209.19)]
運行應用程序時,它顯示如下:
但是,在設備(帶有iOS版本9.3.5的iPhone 5s或6)上運行時,這顯示為以下空白屏幕:
誰能告訴我背后的原因是什么? 幾天前,當我測試它在設備上也可以正常顯示時,然后我面臨傳遞目標地址的問題,現在我面臨着無法加載登錄屏幕的問題,有人可以建議嗎?
有時,網絡視圖可能無法完全加載。 您的屏幕截圖中似乎有一個正在加載的微調器(在wifi圖標旁邊)。 請重試,看看是否可以等待頁面完成加載。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.