Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Fix/access applicationstate on main thread #484

Closed

Conversation

ElektrojungeAtWork
Copy link
Contributor

No description provided.

@@ -197,7 +198,8 @@ - (void)trackEventWithName:(nonnull NSString *)eventName {

// If the app is running in the background.
UIApplication *application = [UIApplication sharedApplication];
if (application && application.applicationState == UIApplicationStateBackground) {
BOOL applicationIsInBackground = ([BITHockeyHelper applicationState] == BITApplicationStateBackground) ? YES : NO;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove ? YES : NO

@@ -222,7 +224,7 @@ - (void)trackEventWithName:(nonnull NSString *)eventName properties:(nullable NS

// If the app is running in the background.
UIApplication *application = [UIApplication sharedApplication];
if (application && application.applicationState == UIApplicationStateBackground) {
BOOL applicationIsInBackground = ([BITHockeyHelper applicationState] == BITApplicationStateBackground) ? YES : NO; if (application && applicationIsInBackground) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove ? YES : NO
Missing line break

if (strongSelf.dataItemCount >= strongSelf.maxBatchSize ||
(application && application.applicationState == UIApplicationStateBackground)) {
(application && applicationIsInBackground)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just applicationIsInBackground, no need to check application here

@ElektrojungeAtWork
Copy link
Contributor Author

This includes:

  • Update to OCmock 3.4.1
  • Update to OChamcrest 6.0.0
  • use completion block to test BITChannel
  • the real reason for this change, accessing the applicationstate property from the main thread.

* Workaround for exporting symbols from category object files.
* See article https://medium.com/ios-os-x-development/categories-in-static-libraries-78e41f8ddb96#.aedfl1kl0
*/
__attribute__((used)) static void importCategories() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work. #486 fixes it.

@ElektrojungeAtWork
Copy link
Contributor Author

Part of #485

@ElektrojungeAtWork ElektrojungeAtWork deleted the fix/access-applicationstate-on-main-thread branch December 11, 2017 17:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants