[英]Uber Widget Login screen showing blank in iPhone but showing in simulator
I am trying to integrate the Uber Widget in my iPhone application (made in Xcode Version 7.3.1
with language Objective C
). 我正在尝试将Uber窗口小部件集成到我的iPhone应用程序(使用语言
Objective C
在Xcode Version 7.3.1
)中。 Put all things as described in Uber-ride-request-widget and Github of Uber rides-ios-sdk . 按照Uber-ride-request-widget和Uber rides-ios-sdk的Github中所述放置所有内容。 Created all the credential which Uber need like
CLIENT_ID
, Service Token
in Uber Developer Account . 在Uber开发人员帐户中创建了Uber所需的所有凭证,例如
CLIENT_ID
, Service Token
。 I have installed pod for Uber as they said: 正如他们所说,我已经为Uber安装了pod:
use_frameworks!
target 'My_Project_Name' do
pod 'UberRides'
end
and ran pod install
and successfully installed the pod
and then 并运行
pod install
并成功安装pod
,然后
Set info.plist
as they described: 按照他们的描述设置
info.plist
:
<key>UberClientID</key>
<string>MY_APP_CLIENT_ID</string>
<key>UberDisplayName</key>
<string>MY_APP_NAME</string>
and 和
<key>UberCallbackURIs</key>
<array>
<dict>
<key>URIString</key>
<string>https://www.google.com</string>
<key>UberCallbackURIType</key>
<string>General</string>
</dict>
</array>
and also added following code in NSExceptionDomains
within NSAppTransportSecurity
keeping NSAllowsArbitraryLoads
to true
并且还添加以下代码
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>
Now added following code in didFinishLaunchingWithOptions
in AppDelegate
现在添加以下代码
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];
and Written following code to make the Uber Widget call: 并编写以下代码来调用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];
Now when I am running the app in Simulator[Version 9.3 (SimulatorApp-645.9 CoreSimulator-209.19)]
it is showing like the following: 现在,当我在
Simulator[Version 9.3 (SimulatorApp-645.9 CoreSimulator-209.19)]
运行应用程序时,它显示如下:
But when running in device (iPhone 5s or 6 with iOS version 9.3.5) this is showing like this blank screen: 但是,在设备(带有iOS版本9.3.5的iPhone 5s或6)上运行时,这显示为以下空白屏幕:
Can anyone tell me what is the cause behind it? 谁能告诉我背后的原因是什么? Some days ago when I tested it was showing fine for device also then I was facing problem of passing the destination address, Now I am facing the problem not loading the Login Screen, Can anyone please suggest?
几天前,当我测试它在设备上也可以正常显示时,然后我面临传递目标地址的问题,现在我面临着无法加载登录屏幕的问题,有人可以建议吗?
Sometimes, there can be a delay for the webview to fully load. 有时,网络视图可能无法完全加载。 It looks like there may be a loading spinner in your screenshot (next to the wifi icon).
您的屏幕截图中似乎有一个正在加载的微调器(在wifi图标旁边)。 Please try again and see if you can wait for the page to finish loading.
请重试,看看是否可以等待页面完成加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.