Code Monkey home page Code Monkey logo

Comments (5)

shafai avatar shafai commented on September 23, 2024

I have the same issue.

from appsales-mobile.

blackfrog avatar blackfrog commented on September 23, 2024

I fixed this locally a few months ago. You just need 3 changes to make it save when the day/week was downloaded instead of when the app exits. Here are the changes to ReportManager.m:

1: In the init function at the top, remove the call to [[NSNotificationCenter defaultCenter] addObserver

2: At the end of successfullyDownloadedDays function, add this line before the line starting with NSNotificationCenter:
[self saveData];

3: At the end of successfullyDownloadedWeeks function, add this line before the line starting with NSNotificationCenter:
[self saveData];

from appsales-mobile.

meachware avatar meachware commented on September 23, 2024

Another option, if you are using iOS 4 only, simply replace the notification type with UIApplicationWillResignActiveNotification The saveData method will be called whenever you enter the background. (I also added all four methods to the appDelegate, not sure if you need to though.)

If you still need iOS 3.x or iPad support you can add this BOOL to the Info.plist to prevent multitasking: UIApplicationExitsOnSuspend (set to TRUE) and then the app will terminate instead of backgrounding and of course call saveData
:-]

from appsales-mobile.

prime31 avatar prime31 commented on September 23, 2024

For multitasking support, you can just change the notification that blackfrog mentions above to listen to UIApplicationDidEnterBackgroundNotification

from appsales-mobile.

meachware avatar meachware commented on September 23, 2024

^^^ sure that's fine if you don't care about saving your "reviews" data. Personally I do care and want to save my "reviews" data and the UIApplicationWillResignActiveNotification fix properly saves all data, not just the sales info when entering the background. :-]

from appsales-mobile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.