与“无法连接到iTunes”关联的此vendorID错误消息是什么?进行应用内购买? [英] What is this vendorID error message associated with "Cannot Connect to iTunes" for in-app purchase?

查看:336
本文介绍了与“无法连接到iTunes”关联的此vendorID错误消息是什么?进行应用内购买?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是一条神秘的错误消息:



LaunchServices:未能获得vendorID



<我猜这是现在一些苹果服务器,现在很快就会重新上线。



背景:



我的iOS应用没有以前批准的应用内购买,所以这仍然是必须与新的应用程序内购买产品一起提交新版本应用程序的阶段。 iTunes Connect中配置了三个测试用户。



今天之前的测试已成功购买测试产品,并检索以前购买的信息。



在休息时发生的事情



今天早些时候我添加了一些服务器获取代码来验证交易。此代码在处理完交易队列后执行,因此在成功获取信息后。



现在发生了什么



应用内购买代码使用StoreKit框架请求产品,并接收它们并适当地显示UI。因此,StoreKit目前至少取得了一定程度的成功。



当我点击UI按钮启动检索过去购买代码时,我输入凭据对于测试用户,我坐着等待。超时,似乎在几秒钟后,出现错误无法连接到iTunes Store。



这在iPhone设备和模拟器上都会发生。



但运行应用程序时Xcode输出窗格中的错误消息显示以下错误,当我按下按钮恢复交易时,它会立即显示当测试用户连接失败时。



LaunchServices:无法获得vendorID



我做了什么尝试修复它



在iPhone上,我退出了我的真实用户,然后使用了测试用户凭据,在模拟器中,我清理了〜/ Library / Application Support / iPhone Simulator / 6.1 / Library / com.apple.itunesstored / * files。



我重新启动了macbook,同样的事情。



谷歌搜索:
+未能获得vendorID



返回零实际结果。我很茫然。

解决方案

看起来静态库项目无权访问vendorID,但他们确实如此可以访问advertiserID。



这可能是在XCode中运行模拟器内部测试的工件 - 也许静态库在链接到真实数据库时可以访问vendorID应用程序在真实设备上运行。



我对两种不同的方案进行了简要测试,并且能够可靠地使 LaunchServices:无法获得vendorID 错误出现在其中一个。



首先,我在XCode中创建了一个空应用程序内置模板。我只修改了这个方法:

   - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{
NSLog(@供应商ID:%@,[UIDevice currentDevice] .identifierForVendor);

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//在应用程序启动后覆盖自定义点。
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
返回YES;
}

这个从未出现过问题。当我直接在模拟器中运行应用程序时,以及当我运行其(生成的)单元测试时,它能够为供应商获取此设备的UUID就好了。



然后我在XCode模板中创建了一个Cocoa Touch Static Library。我在生成的源文件上只创建了一个类方法。

  +(void)logDeviceIDs 
{
NSLog(@供应商ID:%@,[UIDevice currentDevice] .identifierForVendor);
NSLog(@广告ID:%@,[ASIdentifierManager sharedManager] .advertisingIdentifier);
}

然后我改变了生成的测试

   - (void)testExample 
{
[ReportDevice logDeviceIDs];
}

最后我确保改变ReportDeviceTests目标并添加 AdSupport 要链接的库。然后当我执行测试时,模拟器弹出,这是我看到的输出:

  ReportDeviceTests.octest(Tests)'始于2013-08-04 03:56:00 +0000 
Test Suite'ReportDeviceTests'于2013-08-04开始03:56:00 +0000
测试用例' - [ReportDeviceTests testExample]'开始了。
2013-08-03 21:56:00.786 otest [61857:303] LaunchServices:未能获得vendorID
2013-08-03 21:56:00.786 otest [61857:303]供应商ID :( null)
2013-08-03 21:56:00.787 otest [61857:303]广告ID:< __ NSConcreteUUID 0x24bab30> 5801847F-4679-4701-8B07-28449EF92CB4
测试用例' - [ReportDeviceTests testExample]'通过(0.002秒)。

所以在这个测试中,静态库能够获得advertisingIdentifier而不是identifierForVendor,并且成功能够触发无法获得vendorID 错误。



你是否有可能使用静态你写过的图书馆,或者来自外部供应商的图书馆(比如Flurry)?这些是可能给你两个测试用例中最后一个类似行为的潜在来源。



希望有所帮助!


Here's a mysterious error message:

LaunchServices: failed to get vendorID

I'm guessing it's some Apple server that is down right now, and will be back online, sometime soon.

Background:

My iOS app has no in-app purchases previously approved, so this is still the stage where a new version of the app must be submitted along with a new in-app purchase product. There are three test users configured in iTunes Connect.

Testing before today has been successful with buying test products, and retrieving previous purchased info.

What happened at time of "break"

Earlier today I was added some server fetch code to validate the transactions. This code executes after the processing of the transaction queue, so after a successful fetch of information.

What's happening now

The in-app purchase code requests the products using the StoreKit framework, and receives them and displays the UI appropriately. So there is at least some level of success with StoreKit at the moment.

When I tap the UI button to launch the retrieve-past-purchases code, I enter the credentials for a test user, and I sit and wait. Timeout, it would seem, for many seconds later, the error "Cannot connect to iTunes Store" appears.

This occurs on both the iPhone device and simulator.

But the error message in the output pane of Xcode while running the app is showing the following error, and it appears immediately when I'm pressing the button to restore the transactions, and again when the connection fails with test user.

LaunchServices: failed to get vendorID

What I did to try to fix it

On the iPhone, I signed out of my real user and then used the test user credentials, and in simulator, I cleaned out the ~/Library/Application Support/iPhone Simulator/6.1/Library/com.apple.itunesstored/* files.

I restarted the macbook, same thing.

A google search for: +"failed to get vendorID"

returns zero real results. I'm at a loss.

解决方案

It looks like static library projects don't have access to the vendorID, but they do have access to the advertiserID.

This may be an artifact of running the tests inside the simulator in XCode—perhaps a static library has access to the vendorID when linked into a real app run on a real device.

I ran a brief test of two different scenarios, and was able to reliably make the LaunchServices: failed to get vendorID error appear under one of them.

First, I created an "Empty Application" in XCode using the built-in template. I altered only this method:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    NSLog(@"Vendor ID: %@", [UIDevice currentDevice].identifierForVendor);

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

This one never had a problem. Both when I ran the app directly in the simulator, and when I ran its (generated) unit tests, it was able to get the UUID of this device for the vendor just fine.

Then I created a "Cocoa Touch Static Library" in the XCode template. I created only one class method on the generated source file.

+ (void)logDeviceIDs
{
    NSLog(@"Vendor ID: %@", [UIDevice currentDevice].identifierForVendor);
    NSLog(@"Advert ID: %@", [ASIdentifierManager sharedManager].advertisingIdentifier);
}

I then altered the generated test

- (void)testExample
{
    [ReportDevice logDeviceIDs];
}

And finally I made sure to alter the "ReportDeviceTests" target and add the AdSupport library to be linked in. And then when I executed the tests, the simulator popped up and this is the output I saw:

ReportDeviceTests.octest(Tests)' started at 2013-08-04 03:56:00 +0000
Test Suite 'ReportDeviceTests' started at 2013-08-04 03:56:00 +0000
Test Case '-[ReportDeviceTests testExample]' started.
2013-08-03 21:56:00.786 otest[61857:303] LaunchServices: failed to get vendorID
2013-08-03 21:56:00.786 otest[61857:303] Vendor ID: (null)
2013-08-03 21:56:00.787 otest[61857:303] Advert ID: <__NSConcreteUUID 0x24bab30> 5801847F-4679-4701-8B07-28449EF92CB4
Test Case '-[ReportDeviceTests testExample]' passed (0.002 seconds).

So in this test, the static library was able to get the advertisingIdentifier but not the identifierForVendor, and was "successfully" able to trigger the failed to get vendorID error.

Is it possible that you're using static libraries you've written, or that come from an external vendor (say, Flurry)? Those are potential sources which might give you similar behavior to the last of the two test cases.

Hope that helps!

这篇关于与“无法连接到iTunes”关联的此vendorID错误消息是什么?进行应用内购买?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆