utorak, 27. prosinca 2011.

In App purchase coding, programming guide for xcode


I will present you my solution that was processed to app store without problem

1. you need unique app ID (that is app ID that doesn't have wildcard *)
  you can create it accessing trough http://developer.apple.com/iphone

2. create new provisioning profile and download it to your mac

3. code it using xcode (all of above you have detailed expalantion on web site given above, only thing that you don't have to is submit (upload binary) and than cancel your app, that much has changed since author wrote it.

here is how (hope it helps)

in header file
#import <StoreKit/StoreKit.h>

#define kInAppPurchaseManagerProductsFetchedNotification @"kInAppPurchaseManagerProductsFetchedNotification"
#define kInAppPurchaseManagerTransactionFailedNotification @"kInAppPurchaseManagerTransactionFailedNotification"
#define kInAppPurchaseManagerTransactionSucceededNotification @"kInAppPurchaseManagerTransactionSucceededNotification"

@interface RootViewController : UIViewController<SKProductsRequestDelegate, SKPaymentTransactionObserver> {

   
    IBOutlet UIButton *upgradeButton;
   SKProduct *proUpgradeProduct;
    SKProductsRequest *productsRequest;
 
}



- (IBAction) clickOnUpgrade;

- (void)loadStore;
- (BOOL)canMakePurchases;
- (void)purchaseProUpgrade;
- (void)requestProUpgradeProductData;



@property (nonatomic, retain) UIButton *upgradeButton;


in m file (it was designed to be in rootview controller file)

- (void)viewDidLoad {
    [super viewDidLoad];   
   
    //if upgrade purchased hide upgrade button
    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
  //   NSLog(@"haj");
    if ([prefs boolForKey:@"isProUpgradePurchased"]==YES)
        upgradeButton.hidden = YES; else [self loadStore];
   
    [[NSNotificationCenter defaultCenter] addObserver: self
                                             selector: @selector(napraviKupnju:)
                                                 name: kInAppPurchaseManagerProductsFetchedNotification
                                               object: self.view.window];
    [[NSNotificationCenter defaultCenter] addObserver: self
                                             selector: @selector(sakrijGumb:)
                                                 name: kInAppPurchaseManagerTransactionSucceededNotification
                                               object: self.view.window];
   
}

- (IBAction) clickOnUpgrade {
   

    if ([self canMakePurchases]) {
        Kupnja=YES;
    [self requestProUpgradeProductData];
    }
    

   
}

-(void) napraviKupnju: (NSNotification *)notif  {
    //NSLog(@"hello");
   
   
    if (Kupnja==YES)
     [self purchaseProUpgrade];
}

-(void) sakrijGumb: (NSNotification *)notif  {
    upgradeButton.hidden = YES;
}

- (void)requestProUpgradeProductData
{
    NSSet *productIdentifiers = [NSSet setWithObject:@"insert here your unique app ID" ];
    productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers];
    productsRequest.delegate = self;
    [productsRequest start];
   
    // we will release the request object in the delegate callback
}

#pragma mark -
#pragma mark SKProductsRequestDelegate methods

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
    NSArray *products = response.products;
    proUpgradeProduct = [products count] == 1 ? [[products objectAtIndex:0] retain] : nil;
    if (proUpgradeProduct)
    {
        NSLog(@"Product title: %@" , proUpgradeProduct.localizedTitle);
        NSLog(@"Product description: %@" , proUpgradeProduct.localizedDescription);
        NSLog(@"Product price: %@" , proUpgradeProduct.price);
        NSLog(@"Product id: %@" , proUpgradeProduct.productIdentifier);
       
        [[NSNotificationCenter defaultCenter] postNotificationName:kInAppPurchaseManagerProductsFetchedNotification object:self userInfo:nil];
    }
   
    for (NSString *invalidProductId in response.invalidProductIdentifiers)
    {
        NSLog(@"Invalid product id: %@" , invalidProductId);
    }
   
    // finally release the reqest we alloc/init’ed in requestProUpgradeProductData
    [productsRequest release];
   
   
}



#pragma -
#pragma Public methods

//
// call this method once on startup
//
- (void)loadStore
{
    // restarts any purchases if they were interrupted last time the app was open
    Kupnja = NO;
    [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
   
    // get the product description (defined in early sections)
    [self requestProUpgradeProductData];
   
}

//
// call this before making a purchase
//
- (BOOL)canMakePurchases
{//NSLog(@"haj can make purchase");
    return [SKPaymentQueue canMakePayments];
}

//
// kick off the upgrade transaction
//
- (void)purchaseProUpgrade
{//NSLog(@"haj purchase upgrade");
   
    SKPayment *payment = [SKPayment paymentWithProduct:proUpgradeProduct];
    [[SKPaymentQueue defaultQueue] addPayment:payment];
   
}

#pragma -
#pragma Purchase helpers

//
// saves a record of the transaction by storing the receipt to disk
//
- (void)recordTransaction:(SKPaymentTransaction *)transaction
{//NSLog(@"haj 7");
    if ([transaction.payment.productIdentifier isEqualToString:kInAppPurchaseProUpgradeProductId])
    {
        // save the transaction receipt to disk
        [[NSUserDefaults standardUserDefaults] setValue:transaction.transactionReceipt forKey:@"proUpgradeTransactionReceipt" ];
        [[NSUserDefaults standardUserDefaults] synchronize];
    }
}

//
// enable pro features
//
- (void)provideContent:(NSString *)productId
{//NSLog(@"haj 6");
    if ([productId isEqualToString:kInAppPurchaseProUpgradeProductId])
    {
        // enable the pro features
        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"isProUpgradePurchased" ];
        [[NSUserDefaults standardUserDefaults] synchronize];
    }
}

//
// removes the transaction from the queue and posts a notification with the transaction result
//
- (void)finishTransaction:(SKPaymentTransaction *)transaction wasSuccessful:(BOOL)wasSuccessful
{//NSLog(@"haj 5");
    // remove the transaction from the payment queue.
    [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
   
    NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:transaction, @"transaction" , nil];
    if (wasSuccessful)
    {
        // send out a notification that we’ve finished the transaction
        [[NSNotificationCenter defaultCenter] postNotificationName:kInAppPurchaseManagerTransactionSucceededNotification object:self userInfo:userInfo];
    }
    else
    {
        // send out a notification for the failed transaction
        [[NSNotificationCenter defaultCenter] postNotificationName:kInAppPurchaseManagerTransactionFailedNotification object:self userInfo:userInfo];
    }
}

//
// called when the transaction was successful
//
- (void)completeTransaction:(SKPaymentTransaction *)transaction
{//NSLog(@"haj 4");
    [self recordTransaction:transaction];
    [self provideContent:transaction.payment.productIdentifier];
    [self finishTransaction:transaction wasSuccessful:YES];
}

//
// called when a transaction has been restored and and successfully completed
//
- (void)restoreTransaction:(SKPaymentTransaction *)transaction
{//NSLog(@"haj 3");
    [self recordTransaction:transaction.originalTransaction];
    [self provideContent:transaction.originalTransaction.payment.productIdentifier];
    [self finishTransaction:transaction wasSuccessful:YES];
}

//
// called when a transaction has failed
//
- (void)failedTransaction:(SKPaymentTransaction *)transaction
{//NSLog(@"haj 1");
    if (transaction.error.code != SKErrorPaymentCancelled)
    {
        // error!
        [self finishTransaction:transaction wasSuccessful:NO];
    }
    else
    {
        // this is fine, the user just cancelled, so don’t notify
        [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
    }
}

#pragma mark -
#pragma mark SKPaymentTransactionObserver methods

//
// called when the transaction status is updated
//
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{NSLog(@"haj 2");
    for (SKPaymentTransaction *transaction in transactions)
    {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchased:
                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                [self restoreTransaction:transaction];
                break;
            default:
                break;
        }
    }
}

subota, 22. listopada 2011.

Sungazing App

Sungazing application, helping to energize your body and soul.

Sungazing or Solara yoga is a method of using sun energy for health and as energy source for human body. We all know there is no life without sun, one of great benefits of sun is that it gives you vitamin D which is absolutely needed for strong immune system, healthy bones and as anti depressant.
It is known that during winter time when days are shorter and there is not much sun many people are very depressed, and during spring when sun starts to shine more mood in people is elevated. This can also be linked with vitamin D or its absence.

Sungazing was popularised by Hira Ratan Manek who lived solely from sun (and water) for more than 100 days under strict medical observation.
He says that sun is the source of purest food (energy) for humans, and you can learn more by visiting site: http://solarhealing.com/

Sungazing application helps you to monitor your progress in sungazing by timing you. It also gives you notifications about safe hours (safest time to sungaze, that is one hour after sunrise, and one hour before sunset).
Notifications can be simply turned off by using Options and turning off notifications.

By clicking on Options you get:
 Turn off/on Sungazing remainder for sunrise or sunset either turns on or off notifications.

 When you click start sungazing on main screen timer will come up, and after you have sungazed you just confirm it and your time will be stored and increased for 10 seconds for next sungazing.

These are example of option Sunrise/Sunset times on main screen, using your GPS it will give you complete list for next 30 days of sunrise/sunset times.


Happy sungazing!

četvrtak, 16. lipnja 2011.

dr. Martins Coco drink

In times of industrial processed food, lack of essential nutrients like enzymes is overwhelming.
If you eat raw food you shouldn't have any problems with vitamins or enzymes, but since most of the enzymes are destroyed trough termic processing of food (cooking) generally we all have deficiency in enzymes which are used by your body in various process, digestion being one of them, if your digestion is not good your health will be also at low levels.


Coco juice by dr Martins looks pretty good, and if you don't have time to have freshly squeezed juices (vegetables and fruits) you could pick up a carton of Coco drink and fresh up your body system with natural coconut milk.

It all looks good, and if it isn't too expensive for you it is worth a shot. (better than can of soda).

Stay fit and healthy.



ponedjeljak, 16. svibnja 2011.

PhysiqueBuild Iphone app


Iphone app that will learn you to lose fat, gain muscle within weeks without steroids. 

If knowledge is power you will get it with PhysiqueBuild for almost nothing.
It is like giving away how to become Jedi in bodybuilding for nothing.


NOTICE
*achievemint when registered is started with "rest timer" under any exercise. When Rest Timer is started it will generate data for achievemint.

LATEST UPDATE
*Intermittent Fasting

UPDATES

*Ultra Mass exercise program - simple and efficient
*Ab Killer - new exercise that will leave your abs sore for days!

*Libido enhancing supplements that will turn your lover abilities into superhuman lover abilities (for men and women)






If you have any questions please contact me for PhysiqueBuild at feniksapp@gmail.com
I will answer all your questions.





You can benefit from this app in many ways:
       Would you want to gain 2-5 pounds of muscle in just 10 days, and being natural without use of anabolic steroids, you can do it, just read Gaining Monster Mass instructions in nutrition part.
       Do you want how to structure your training and different training routines for Mass, Definition or Strength?
       Find out what supplements are worth your money and don't spend money on unuseful supplements.







Crazy Mike's review (since the review there where more than several updates and additions)




For customers who purchased before upgrading to IOS5
If you have experienced troubles with app after upgrade to IOS5 just delete app (press and hold icon until it starts to shake and then press X) and re-install it, it should work fine.
*be sure to have latest update.

četvrtak, 24. veljače 2011.

Fructose bad or good?

Fructose is most heavily industry used sweetener in world, but is it good for you? Answer is simple NO.
Stay away from fructose it is simple as that.

There are many drinks marketed as low glycemic index (it does not elevate levels of blood sugar, which in return does not raise levels of powerful hormone insuline, and it does not make you fat, or at least that is way it is marketed) drinks, loaded with fructose, truth is quite opposite.
Fructose can actually lead to insulin disfunction and to type 2 diabetes.
It can also (and it does) lead to higher LDL, VLDL (toxic fat) levels in blood, which could lead to heart attack.

Fructose gets its name from natural source of it, fruits. While fruits have fructose it is not the same that you will get in soft drinks. Why?, because fruit is loaded with enzymes that will help your body to use fructose properly and digest it in right way, while industry made corn starch fructose is deprived of any kind of enzymes and vitamines that are needed for body to use fructose properly.

Fructose in self makes you high level of bad cholesterol, without much needed enzymes you will end up with clogged veins and arteries.

So in conclusion what should you be aware:
  avoid industry made corn starch fructose that is present in most soft drinks, and many other products, just start to read labels on products and if you see fructose, avoid it or consume in moderation, you are better off without fructose if you care about health in particular about diabates and heart health.
Even if you don't care about health if you care about your looks fructose can make you and will make you fat.