iOS In App Purchase仅在App评论中崩溃 - 在沙盒测试中找到作品

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS In App Purchase仅在App评论中崩溃 - 在沙盒测试中找到作品相关的知识,希望对你有一定的参考价值。

我有一个新的应用程序已被拒绝两次与相同的崩溃日志。他们说当他们点击购买按钮进行应用程序购买时它会崩溃并给我崩溃文件。我已经象征了它并且它对我没有多大帮助,其他人可以看看并指出是否有什么问题?

IAP已在沙盒中成功测试,有2个沙盒用户。我还确保我的IAP实际上已从我这边“清除出售”并且“已提交审核”。我的银行帐户信息也是最新的,合同也已批准。

这是符号化的日志:

{"app_name":"APPNAME","timestamp":"2017-12-18 08:48:19.56 -0800","app_version":"1.0","slice_uuid":"915a18a0-7c26-3ffd-af45-102cc6d53e21","adam_id":1326580740,"build_version":"2","bundleID":"com.MYCOMPANY.APPNAME","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 11.2.1 (15C153)","incident_id":"43C16882-BFF8-4C5E-80D7-01AEEE78F017","name":"APPNAME"}
Incident Identifier: 43C16882-BFF8-4C5E-80D7-01AEEE78F017
CrashReporter Key:   6079b68e9b231d52a24bc0ce1c55aa975b16774c
Hardware Model:      xxx
Process:             APPNAME [1217]
Path:                /private/var/containers/Bundle/Application/81E108AB-4E43-4034-9A37-6C83929E75D4/APPNAME.app/APPNAME
Identifier:          com.MYCOMPANY.APPNAME
Version:             2 (1.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.MYCOMPANY.APPNAME [832]


Date/Time:           2017-12-18 08:48:19.4110 -0800
Launch Time:         2017-12-18 08:43:02.9432 -0800
OS Version:          iPhone OS 11.2.1 (15C153)
Baseband Version:    6.30.04
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called

Filtered syslog:
None found

Last Exception Backtrace:
0   CoreFoundation                  0x18411e364 __exceptionPreprocess + 124
1   libobjc.A.dylib                 0x183364528 objc_exception_throw + 55
2   CoreFoundation                  0x18411e2ac +[NSException raise:format:] + 115
3   StoreKit                        0x19758aa98 -[SKPaymentQueue addPayment:] + 539
4   APPNAME                     0x1007a362c 0x100798000 + 46636
5   UIKit                           0x18d6346b4 -[UIApplication sendAction:to:from:forEvent:] + 95
6   UIKit                           0x18d634634 -[UIControl sendAction:to:forEvent:] + 79
7   UIKit                           0x18d61f1dc -[UIControl _sendActionsForEvents:withEvent:] + 439
8   UIKit                           0x18d633f28 -[UIControl touchesEnded:withEvent:] + 575
9   UIKit                           0x18d633a48 -[UIWindow _sendTouchesForEvent:] + 2543
10  UIKit                           0x18d62ef60 -[UIWindow sendEvent:] + 3207
11  UIKit                           0x18d5fff64 -[UIApplication sendEvent:] + 339
12  UIKit                           0x18df5531c __dispatchPreprocessedEventFromEventQueue + 2363
13  UIKit                           0x18df578a8 __handleEventQueueInternal + 4759
14  UIKit                           0x18df507c0 __handleHIDEventFetcherDrain + 151
15  CoreFoundation                  0x1840c697c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 23
16  CoreFoundation                  0x1840c68fc __CFRunLoopDoSource0 + 87
17  CoreFoundation                  0x1840c6184 __CFRunLoopDoSources0 + 203
18  CoreFoundation                  0x1840c3d5c __CFRunLoopRun + 1047
19  CoreFoundation                  0x183fe3e58 CFRunLoopRunSpecific + 435
20  GraphicsServices                0x185e90f84 GSEventRunModal + 99
21  UIKit                           0x18d66367c UIApplicationMain + 235
22  APPNAME                     0x1007aab60 0x100798000 + 76640
23  libdyld.dylib                   0x183b0056c start + 3


Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x0000000183c302e8 __pthread_kill + 8
1   libsystem_pthread.dylib         0x0000000183d452f8 pthread_kill$VARIANT$mp + 396
2   libsystem_c.dylib               0x0000000183b9efbc abort + 140
3   libc++abi.dylib                 0x000000018333b068 __cxa_bad_cast + 0
4   libc++abi.dylib                 0x000000018333b210 default_unexpected_handler+ 8720 () + 0
5   libobjc.A.dylib                 0x0000000183364810 _objc_terminate+ 34832 () + 124
6   libc++abi.dylib                 0x000000018335354c std::__terminate(void (*)+ 107852 ()) + 16
7   libc++abi.dylib                 0x0000000183353158 __cxa_rethrow + 144
8   libobjc.A.dylib                 0x00000001833646e8 objc_exception_rethrow + 44
9   CoreFoundation                  0x0000000183fe3ec4 CFRunLoopRunSpecific + 544
10  GraphicsServices                0x0000000185e90f84 GSEventRunModal + 100
11  UIKit                           0x000000018d66367c UIApplicationMain + 236
12  APPNAME                     0x00000001007aab60 0x100798000 + 76640
13  libdyld.dylib                   0x0000000183b0056c start + 4

Thread 1 name:  com.apple.uikit.eventfetch-thread
Thread 1:
0   libsystem_kernel.dylib          0x0000000183c0f568 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000183c0f3e0 mach_msg + 72
2   CoreFoundation                  0x00000001840c6308 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x00000001840c3ed4 __CFRunLoopRun + 1424
4   CoreFoundation                  0x0000000183fe3e58 CFRunLoopRunSpecific + 436
5   Foundation                      0x0000000184a19594 -[NSRunLoop+ 50580 (NSRunLoop) runMode:beforeDate:] + 304
6   Foundation                      0x0000000184a389ac -[NSRunLoop+ 178604 (NSRunLoop) runUntilDate:] + 96
7   UIKit                           0x000000018e1cd7b8 -[UIEventFetcher threadMain] + 136
8   Foundation                      0x0000000184b1b0f4 __NSThread__start__ + 996
9   libsystem_pthread.dylib         0x0000000183d442b4 _pthread_body + 308
10  libsystem_pthread.dylib         0x0000000183d44180 _pthread_body + 0
11  libsystem_pthread.dylib         0x0000000183d42b74 thread_start + 4

Thread 2 name:  com.apple.NSURLConnectionLoader
Thread 2:
0   libsystem_kernel.dylib          0x0000000183c0f568 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000183c0f3e0 mach_msg + 72
2   CoreFoundation                  0x00000001840c6308 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x00000001840c3ed4 __CFRunLoopRun + 1424
4   CoreFoundation                  0x0000000183fe3e58 CFRunLoopRunSpecific + 436
5   CFNetwork                       0x00000001848d3128 -[__CoreSchedulingSetRunnable runForever] + 780
6   Foundation                      0x0000000184b1b0f4 __NSThread__start__ + 996
7   libsystem_pthread.dylib         0x0000000183d442b4 _pthread_body + 308
8   libsystem_pthread.dylib         0x0000000183d44180 _pthread_body + 0
9   libsystem_pthread.dylib         0x0000000183d42b74 thread_start + 4

Thread 3:
0   libsystem_pthread.dylib         0x0000000183d42b68 start_wqthread + 0

Thread 4:
0   libsystem_pthread.dylib         0x0000000183d42b68 start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib         0x0000000183d42b68 start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x00000001c40f9937
    x4: 0x0000000183358afd   x5: 0x000000016f6674d0   x6: 0x000000000000006e   x7: 0xffffffffffffffec
    x8: 0x0000000008000000   x9: 0x0000000004000000  x10: 0x0000000183d495e0  x11: 0x0000000000000003
   x12: 0xffffffffffffffff  x13: 0x0000000000000001  x14: 0x0000000183bb553f  x15: 0x0000000000000010
   x16: 0x0000000000000148  x17: 0x00000000ffffffff  x18: 0xfffffff00e09925c  x19: 0x0000000000000006
   x20: 0x00000001b4e6fb80  x21: 0x000000016f6674d0  x22: 0x0000000000000303  x23: 0x00000001b4e6fc60
   x24: 0x00000001c0005270  x25: 0x0000000000000000  x26: 0x0000000000000001  x27: 0x0000000000000000
   x28: 0x000000016f667b30   fp: 0x000000016f667430   lr: 0x0000000183d452f8
    sp: 0x000000016f667400   pc: 0x0000000183c302e8 cpsr: 0x00000000
答案

我解决了这个问题

在Xcode>目标>功能>确保在此处启用In app purchase。如果你不这样做,那么在使用Sandbox进行测试时,应用内购买就可以了。但是,当应用程序审核将测试或应用程序处于活动状态时,点击“购买”按钮将导致应用程序崩溃,因为由于某种原因,产品将无法加载。崩溃日志不会太有用,因为它只会显示StoreKit崩溃,但不会提及任何有关功能的内容。 IAP需要在功能中启用IAP才能在实时应用程序中工作。我不知道为什么Sandbox测试和App review / Live应用程序之间存在这种不一致。

同样在代码中,如果产品不是addPayment,只做nil。由于我的功能未设置,因此产品未加载。因此,当我打电话给addPayment时,它崩溃了:

[SKPaymentQueue addPayment:]

同样在iTunes中,在银行信息中,确保设置了“帐户持有人类型”字段。不确定这是否是一个新的领域,但没有设置思维,我已成功提交IAP 5年。只是这一次,它说没有设置持有人类型。

现在,应用审核小组尚未报告IAP崩溃。

以上是关于iOS In App Purchase仅在App评论中崩溃 - 在沙盒测试中找到作品的主要内容,如果未能解决你的问题,请参考以下文章

从 App 内获取 iOS In-App-Purchase 产品的产品参考名称

iOS In App Purchase in Action Extension 应用程序

iOS8 In App Purchase收据验证

加载产品详细信息时,Cordova iOS In App Purchase 崩溃

iOS 14 In-App Purchase 请求登录/验证两次

iOS的in-app purchase C#服务器二次验证实现