繁体   English   中英

Uber Widget登录屏幕在iPhone中显示为空白,但在模拟器中显示

[英]Uber Widget Login screen showing blank in iPhone but showing in simulator

我正在尝试将Uber窗口小部件集成到我的iPhone应用程序(使用语言Objective CXcode Version 7.3.1 )中。 按照Uber-ride-request-widgetUber rides-ios-sdk的Github中所述放置所有内容。 Uber开发人员帐户中创建了Uber所需的所有凭证,例如CLIENT_IDService 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>

并且还添加以下代码NSExceptionDomainsNSAppTransportSecurity保持NSAllowsArbitraryLoadstrue

        <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>

现在添加以下代码didFinishLaunchingWithOptionsAppDelegate

// 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)]运行应用程序时,它显示如下:

Uber登录的模拟器图像

但是,在设备(带有iOS版本9.3.5的iPhone 5s或6)上运行时,这显示为以下空白屏幕:

实时iPhone 6图片

谁能告诉我背后的原因是什么? 几天前,当我测试它在设备上也可以正常显示时,然后我面临传递目标地址的问题,现在我面临着无法加载登录屏幕的问题,有人可以建议吗?

有时,网络视图可能无法完全加载。 您的屏幕截图中似乎有一个正在加载的微调器(在wifi图标旁边)。 请重试,看看是否可以等待页面完成加载。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM