Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS IAP Crash #30

Closed
appetizermonster opened this issue Jan 19, 2017 · 6 comments
Closed

iOS IAP Crash #30

appetizermonster opened this issue Jan 19, 2017 · 6 comments

Comments

@appetizermonster
Copy link

SDK Version: OneSignal-Unity-SDK v2.1.4

I used OneSignal-Unity-SDK in my iOS unity game. (Internally, the game uses UnityIAP)
In OneSignal-Unity-SDK v2.1.3, I tried to purchase in-app items, my game always crashed.
and it seems it has fixed in v2.1.4.

but crash happens again in v2.1.4 (maybe it's the worst)

Here is how to reproduce:

  1. Make in-app purchases
  2. Close app (terminate) before success message appears
  3. Run app again, and you will see app crash
    and You can't run app again. (it's worst)

and I workaround this issue by replacing OneSignal-iOS-SDK library with removing IAP Tracking.

@jkasten2
Copy link
Member

@appetizermonster Can you attach the full crash log as well? The stack trace is most likely different.

Thanks.

@appetizermonster
Copy link
Author

Here is the crash log.

plzpuppy 2017. 1. 19. AM 9-44.zip

@jkasten2
Copy link
Member

jkasten2 commented Jan 19, 2017

@appetizermonster Thanks! The issue is due to SKProductsRequest not being cleanup on de-allocation. Added clean up for this and prevented a 2nd instance of the IAP tracking class which will prevent any other possible race conditions.

Since you have a test device in this state already can you confirm that this build fixes the issue?
https://www.dropbox.com/s/ym7q4bknws2vqn2/libOneSignal(2.3.6-IAP-dealloc-fix).zip?dl=0

Extract it to Assets/OneSignal/Platforms/iOS/libOneSignal.a and replace the existing one.

You should be able to just to redeploy your app (without uninstalling) and the app should run correctly again.

@yamanyar
Copy link

yamanyar commented Mar 1, 2017

We had the same problem and the libOneSignal.a file you provided fixed the issue.

We were using OneSignal 2.1.4

The error we had was:

#0. Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x1902aaf70 objc_msgSend + 16
1  StoreKit                       0x19e511bf0 __34-[SKProductsRequest _handleReply:]_block_invoke + 52
2  libdispatch.dylib              0x1906ea1fc _dispatch_call_block_and_release + 24
3  libdispatch.dylib              0x1906ea1bc _dispatch_client_callout + 16
4  libdispatch.dylib              0x1906eed68 _dispatch_main_queue_callback_4CF + 1000
5  CoreFoundation                 0x19180e810 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
6  CoreFoundation                 0x19180c3fc __CFRunLoopRun + 1660
7  CoreFoundation                 0x19173a2b8 CFRunLoopRunSpecific + 444
8  GraphicsServices               0x1931ee198 GSEventRunModal + 180
9  UIKit                          0x1977817fc -[UIApplication _run] + 684
10 UIKit                          0x19777c534 UIApplicationMain + 208
11 gameblast                      0x10007accc main (main.mm:32)
12 libdispatch.dylib              0x19071d5b8 (Missing)

@jkasten2
Copy link
Member

@appetizermonster @yamanyar This fix is now included in our 2.2.0 Unity SDK release.

@elijahrender
Copy link

Thank you thank you thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants