Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7556049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:46:26+00:00 2026-05-30T11:46:26+00:00

Is it normal when you submit an In-App Purchase, that it causes applicationWillResignActive while

  • 0

Is it normal when you submit an In-App Purchase, that it causes applicationWillResignActive while it asks you if you want to BUY?

For example:

    [[SKPaymentQueue defaultQueue] addPayment:payment];

This causes app to resign active and then once you hit BUY or CANCEL and then applicationWillEnterForeground is called.

Is there a way to know that it was an in app purchase that caused the application to resign so that when it enters foreground again, I can flag some things to be skipped?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:46:27+00:00Added an answer on May 30, 2026 at 11:46 am

    Ok, this is what I am going to do since I cannot think of any other way of doing it…

    When an application starts up fresh it calls application:didFinishLaunchingWithOptions, and when it starts from the background it calls applicationWillEnterForeground. In both these two cases, it then always calls applicationDidBecomeActive, which is where I have the code that I want to skip when an IAP occurs.

    When an application shuts down or moves to the background it always calls applicationWillResignActive and then applicationDidEnterBackground.

    What I noticed is that an IAP calls applicationWillResignActive and then applicationDidBecomeActive and nothing else.

    So in application:didFinishLaunchingWithOptions I will set a variable startupDidFinish=1

    And in applicationWillEnterForeground I will set a variable startupForeground=1

    In applicationDidBecomeActive I will do this:

        //SKIP if application resigned active then becomes active again.
        if (startupDidFinish == 1 || startupForeground==1) {
            //Do normal startup stuff
    
        }
        startupDidFinish = 0;
        startupForeground = 0;
    

    So this will allow you to skip code for things like IAP (and I think also an SMS acts the same way).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form element and that has a normal submit button but I
I have a asp.net app that I want to disable the buttons as soon
We provide the ability to submit images to a user's gallery. While the normal
I've got a page with a normal form with a submit button and some
I'm trying to submit a form through AJAX instead of using the normal POST
I have an ASP.NET MVC3 app that features a form with a nested-table input
In my form I have a normal submit button which validate my form with,
I am using jQuery modal dialogs in my app to handle normal CRUD operations.
In my Rails app I am attempting to create a form that allows users
I have a console app that makes a single request to a web page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.