SpriteKit Game - SKScene Freezes during In-App Purchase in iOS 8.3

171 views Asked by At

I have developed my first SpriteKit game and implemented in-app purchase in SKScence (not UIViewController). In my SKScene, there are locked items and all have zPosition<=+10. When user touches on any locked item, a transparent background (SKSpriteNode named "bgTransparent") appears on the top of all those items with zPosition=+20 and then another SKSpriteNode named "connectingMSG" (an image with message "connecting to Apple Store") appears on the top of transparent background with zPosition=+30. Once purchase is made, then I am removing locks, bgTransparent and connectingMSG using "removeFromParent"

bgTransparent =[SKSpriteNode
                        spriteNodeWithImageNamed:@"Bg_New_Moon_1_2320.png"];
        
        [bgTransparent setScale:.25];
        bgTransparent.size = self.frame.size; 
        bgTransparent.position= CGPointMake(0,0);
        bgTransparent.zPosition= +20;
        bgTransparent.alpha=0.55; 
        bgTransparent.anchorPoint = CGPointZero;
        bgTransparent.name=@"bgTransparent";
        [self addChild:bgTransparent];
        
        connectingMSG =[SKSpriteNode
                        spriteNodeWithImageNamed:@"connectingTo_1.png"];
        
        [connectingMSG setScale:.36];
        connectingMSG.position= CGPointMake(self.size.width/2-60, 80);
        connectingMSG.zPosition= +30; // top of bgTransparent
        connectingMSG.anchorPoint = CGPointZero;
        connectingMSG.name=@"connectingMSG";
        [self addChild:connectingMSG];

[connectingMSG removeFromParent];
[bgTransparent removeFromParent];

In-app purchase is working fine in iOS 8.2. I tested it on iPad with iOS 8.2 and all simulators (iOS8.2). I also developed this game in Xcode 6.2 with base SDK iOS 8.2. Submitted it to APPLE and game got REJECTED because they tested it on iOS 8.3 and they found a bug (no crash). In iOS 8.3, user can buy and complete In App Purchase, Purchase confirmation appears, Tap on OK and modal alert disappears but no further action occurs and In App Purchase remains locked.

I upgraded my iPad to iOS 8.3 and what happening is that scene is freezing as soon as in app purchase screen appears. For Example: connectingMSG,bgtransparent are not being removed even if I click cancel on following screen and don't sign-in while they disappear in iOS 8.2

https://i.stack.imgur.com/f3O3K.png

same happens when I sign-in and make purchase. It freezes and nothing happens after touching again and again.

In console, it shows all NSLog messages that I am using after removing connectingMSG, bgTransparent and locks. So I know that code is running till end and removefromParent code i. It just doesn't remove SpriteNodes and refresh screen.

It is still working fine on iOS 8.2 but not on iOS 8.3. How do I fix it? Is it freezing because I am purchasing directly from SKScence (not UIViewController).

Please reply.

0

There are 0 answers