Note that there are some explanatory texts on larger screens.

plurals
  1. POMKStoreKit 4.0 for Auto-renewal subscriptions
    primarykey
    data
    text
    <p>The app is such that all content can be accessed only once a user has subscribed to a scheme (1 month, 3 months, 6 months or a year). So initially when the app is first installed a view with options to buy these schemes appears. Once a user selects a scheme and makes a purchase he is given access.</p> <p>I initialize the delegate at application: didFinishLaunchingWithOptions: In the first ViewController I listen for the kProductFetchedNotification notification. and once I receive all the products i populate the interface. I also check if a subscription is active</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(productFetchSuccesful:) name:kProductFetchedNotification object:nil]; ... if([[MKStoreManager sharedManager] isSubscriptionActive:kFeatureAId]){ [self grantAccess]; }else if([[MKStoreManager sharedManager] isSubscriptionActive:kFeatureBId]){ ... ... } -(void)productFetchSuccesful:(NSNotification*)notification{ NSArray *products = (NSArray*)[[MKStoreManager sharedManager] purchasableObjectsDescription]; NSLog(@"%@",products); //*****populate ui } </code></pre> <p>Once the interface is populated. The UIbuttons associated with each subscription scheme is linked to an IBAction</p> <pre><code>-(IBAction)purchaseSubscription:(id)sender{ UIButton *currentBtn = (UIButton*)sender; switch (currrentBtn.tag) { case product1Tag: [[MKStoreManager sharedManager] buyFeature:kFeatureAId onComplete:^(NSString* purchasedFeature) { NSLog(@"Purchased: %@", purchasedFeature); [self grantAccess]; } onCancelled:^ { }]; break; case product2Tag: ... ... ... } } </code></pre> <p>I have set the values in the MKStoreKitConfigs.h have set OWN_SERVER and shared secret</p> <pre><code>#define kConsumableBaseFeatureId @"com.mycompany.myapp." #define kFeatureAId @"1month" #define kFeatureBId @"7days" #define kConsumableFeatureBId @"com.mycompany.myapp.005" #define FishBasket @"FishBasket" #define SERVER_PRODUCT_MODEL 1 #define OWN_SERVER @"http://testsite.com/demo/itunes" #define REVIEW_ALLOWED 1 //#warning Shared Secret Missing Ignore this warning if you don't use auto-renewable subscriptions #define kSharedSecret @"*****" </code></pre> <p>I have put up the server side codes as well but it doesn't seem to be working. Nothing seems to be recorded in the database as well.</p> <p>How do I get this right?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload