Skip to content

Conversation

@Nightsd01
Copy link
Contributor

@Nightsd01 Nightsd01 commented Jan 9, 2018

• Fixes a small leak in OneSignalLocation


This change is Reviewable

* Instead of having to manually build an HTTP request every time the app needs to make a request with the backend, this commit simplifies the process by encapsulating all of this code in a few classes.
* Also fixes an issue with registerUser where location data was not being sent. The location data was being added to 'dataDic' after it got serialized into JSON data
* Forgot to import appropriate headers breaking a test.
* Closed the url_session branch since it is now obsolete
* Due to the fact that we've switched to a new rest model, the old enqueueRequest:onSuccess... method is no longer needed and has been removed from the project
* Also removed the overrider for this method from unit test shadows
* Fixes some typos
* Accesses OneSignalClient sharedClient using a property accessor instead of a method getter for cleaner syntax
* Moves JSON parser method to OneSignalClient class for logical consistency
* Removes unnecessary log statements
* Fixes an issue iOS 7, buttons were not being shown on the UIAlertView when the app was in focus.
* Also fixes an issue where the button action ID wasn't being forwarded to the host application (via OSHandleNotificationActionBlock)
* Minor commit to remove the OneSignalHTTPClient from the project since it is no longer used.
* Resolves a memory leak introduced by creating NSURLSession instances and not calling [session finishTasksAndInvalidate]. The effect of this leak was relatively small since it only leaks 600 bytes per request, but it does add up over time.
* Switched OneSignalClient to use a single shared instance of NSURLSession instead of creating a new instance for every HTTP request.
* For the Extension image download function, added a function call in OneSignalHelper.m so that the NSURLSession instance is not leaked.
• Fixed an issue in this branch where the Get iOS Params request was displaying a 'missing App ID' error in the debug console.
• Added logging for verbose mode showing HTTP requests & parameters
• Made it so that requests that require an app ID yet are given a nil/empty app ID will return an NSError and log an error to the console.
• Fixed a small memory leak in OneSignalLocation
• malloc() was being used to initialize a temporary location but free() was never called on it so it never got released
• Also, added a required CLLocationManager delegate method to prevent a crash in the event of a location manager error
@jkasten2
Copy link
Member

Reviewed 13 of 13 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@Nightsd01 Nightsd01 merged commit 4237782 into master Jan 10, 2018
@Jeasmine Jeasmine deleted the fix_leak branch May 12, 2020 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants