Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error #16

Closed
glancashire opened this issue Mar 2, 2016 · 2 comments
Closed

Compilation error #16

glancashire opened this issue Mar 2, 2016 · 2 comments

Comments

@glancashire
Copy link

Dear Madams and Sirs

First thanks for a great service with a simple api.

However I get compilation errors, as I have an object called Category. This conflicts with the objc/runtime.h header file, which you import.

Please comment out the following line in your header

import <objc/runtime.h>

It works fine and my compilation errors disappear.

Kind Regards
Graham

@jkasten2
Copy link
Member

jkasten2 commented Mar 9, 2016

Thanks for reporting the issue, I'll try it out in the next update.

@jkasten2
Copy link
Member

Fixed in the 1.12.0 Release.

mikechoch added a commit that referenced this issue Sep 5, 2019
* JS method getPageMetaData() crashes between JS and Objective C when trying to send over a DOMRect in the JSON. Changes were changed in backend and a PR has been created, once it is approved and merged the height can be adjusted for orientation changes.
* Methods created for webView adjustments during runtime so when orientation change occurs webView is removed from superview and fills screen and new height can be calculated using JS getPageMetaData(). Then the webView will be placed back inside the messageView with correct constraints set and height.
* Currently the method for handling new height calculation  during orientation change is commented out with a TODO until the JS code is updated to prevent crash.
mikechoch added a commit that referenced this issue Sep 9, 2019
* In App Messaging Initial Commit

• Adds in-app messaging core classes
• The SDK currently only displays https://www.google.com as the content of in-app messages
• TODO: Build out triggers. Finalize the API spec

* Add Model Tests

• Adds tests to ensure that OSInAppMessage objects can be parsed from JSON correctly using our new OSJSONDecodable protocol

* JS In-App Message Actions

• Adds WebKit listener code to handle actions from the HTML content of messages
• When a user taps an action, the SDK will alert delegates with the action ID and any arbitrary data associated with the action

* Remove JSON Data

• Decided that having a data parameter associated with actions would not provide much benefit and likely won't get implemented in 1.0

* Improved Layout Constraints

• Improves the constraints for the message view. Fixed an issue where the message view, on some devices, could be cut off.
• Improved the dummy message views
• Adds buttons to the demo app to display the different types of messages

* Add Support for Triggers

• Adds support for local triggers to display in-app messages.
• The triggers are implemented as a 2D array, where the first level signifies OR conditions and the second level signifies AND conditions

* Invalid Operator Test

• Adds a test to ensure that attempting to initialize a trigger with an invalid operator will not crash but will fail to initialize and will return nil

* Rename Trigger Controller

• Renames OSMessagingTriggerController to OSTriggerController
• Adds a new class (OSDynamicTrigger) to represent non-key/value triggers, such as session_duration

* Rename Protocol Method

• Renames the initWithData() and initWithJson() methods of the OSJSONDecodable protocol that represents classes that are decodable from JSON
• Renamed these methods to class methods like instanceWithData(). This is cleaner, so that instead of having to use [[OSTrigger alloc] initWithData:data] you can instead use [OSTrigger instanceWithData:data]

* Add Contains Operator

• Adds a "contains" operator to allow developers to check if a message' trigger value exists in a local trigger array

* Add Macros

• Adds macros to clean up type conversion code a bit.

* Fix Compiler Optimization Level

• The compiler optimization level for the Tests target was previously defaulting to -O1
• The problem is that when any level of compiler optimization is enabled, the LLDB debugger usually loses the ability to resolve symbols/values at runtime
• Fixed by completely disabling all compiler optimization for the Tests target.

* Add Dynamic Triggers

• We want the SDK to be able to support dynamic triggers, so that developers can specify that a message should be shown at a specific time or prevent messages from being shown at certain times
• Created an OSDynamicTriggerController class that can schedule timers when needed
• The logic looks a bit more complicated than one would expect, but there are reasons for this. For example, an in-app message may potentially use multiple time-based trigger conditions. We also want to make sure time-based triggers aren't even evaluated unless they are the only triggers that still apply (ie. if "gameScore" is required to be 30 for a message but is currently 20, there is no point in scheduling a timer for any additional time-based triggers until gameScore is set to 30+)

* Fix Dynamic Triggers

• In previous commits I hadn't considered that operators could be used with dynamic triggers. This commit adds support for using operators with dynamic triggers.

* Fix Logic Error

• Fixes a logic error with the dynamic trigger controller where the session duration was being calculated incorrectly (negative instead of positive)

* Add Max Display Time

• Adds a new parameter (max display time) to inapp messages so they are automatically dismissed after being shown for a certain amount of time.

* Implement Message Display Queue

• Implements a queue so that if multiple in-app messages are eligible to be shown, they are shown sequentially.

* Reset Session Launch Time in Tests

• The session duration test needs the session launch time to be reset between tests so that it can assume the session launch time is now (just launched).

* Add SDK Version Check Test

• Checking SDK version is a supported trigger - added test to cover this scenario

* Stop Timers

• To prevent causing unintended issues with other tests, I've added logic to stop NSTimers from being created in the in-app message unit tests

* Add Integration Tests

• Adds a few integration tests for in-app messaging.
• The SDK mocks the server response for registration and then checks to make sure that the response (which has an in-app message with a dynamic duration-based trigger) correctly sets up a timer
• Adds an overrider class to mock the Message Controller's method that actually displays message UI.
• Adds a check to send in-app message data to the message controller if found in the response to registration
• Added a method to the OneSignalClientOverrider that allows us to mock API responses. This is currently implemented in a very simplistic way but I plan in the future to have a more comprehensive API mocking solution

* Fix Swizzle

• Fixes a mistake made when swizzling a method on OSMessagingController

* Add More Integration Tests

• Adds additional tests to verify that messages actually get displayed, and that messages won't overlap if two messages are eligible to be displayed at the same time
• Makes our helper methods a bit clearer/easier to understand by moving them to their own class instead of being category methods implemented on OSInAppMessage
• Adds a test helper category on OSMessagingController to let tests set triggers and reset state (clear queue of displayed messages)

* Add Integration Test

• Adds a new test that checks the full in-app message flow from registration JSON to making sure the message actually gets shown after a session_duration delay

* Add Not Equal To Operator

• We already had an == operator. This commit adds an != operator and a test

* Add Device Type Trigger Support

• Adds support for filtering in-app messages using a device type trigger (for "phone" vs. "tablet"), added some tests as well

* Fix Commit

• Forgot to stage some files in the previous commit. Adds a PBXProject include reference for the Tablet/Phone detection trigger, adds support for the Not Equal To trigger

* Add NotExists Operator

• Adds a new "not_exists" trigger operator and test

* Fix Test Timer

• Fixes an issue where the timer wasn't being properly initialized & added to the runloop in tests

* Reset Test State

• Adds a category method to OSMessagingController to make sure that state is reset between tests

* Add JSON Representation to Message & Trigger Classes

• Adds methods so that Message and Trigger classes conform to the JSON encoding protocol, to make debugging/testing easier.

* Fix Floating Point Error

• Because NSTimers are not exactly accurate, I added checks to ensure that triggers will handle floating point comparisons appropriately.
• Adds a missing macro that converts OSMessageDisplayType enums to strings

* Add Integration Test

• Adds an integration test that checks to make sure timer-based triggers aren't scheduled until all other conditions/triggers evaluate to true.

* Publicly Expose Trigger Methods

• Publicly exposes Trigger methods like setTriggerForKey:withValue:
• Because the trigger controller is a property of the OSMessagingController singleton, these functions in OneSignal simply call the same methods on the OSMessagingController singleton, which calls them on its trigger controller property

* Fix Example Demo

• Fixes the dev demo project so that it correctly displays test messages (we recently changed to using two-dimensional arrays to store triggers to allow OR conditions)

* Add Trigger Identifiers

• Because the SDK can launch timers for some triggers, it needs a way to get a unique identifier for triggers to avoid launching duplicate timers for the same trigger.
• However, the API does not assign ID's to triggers.
• To ensure consistency and avoid duplication, I've added a method to generate unique string ID's for a given trigger+message pair
• The string takes the following format: for a message operating on "game_score" to be less than 30 for a message with "testID" as the ID, the produced unique ID string would be "game_score<30::testID"
• Adds tests to ensure consistency

* Simplify Test

• Simplifies the `testTriggerIdentifier` test, which tests multiple trigger identifier strings to ensure the SDK is producing correct unique values

* Use Macro instead of C functions

• Since timers in iOS are somewhat inaccurate by default due to battery constraints, when comparing timestamps we want to account for a small amount of error.
• To do this, I added some simple C functions in previous commits to account for this as well as floating point error.
• However it's simpler to do this using a macro, so I've removed the C functions and replaced them with a simple macro.

* Remove Blur Effect

• I've removed the blur effect from in-app messages and now the SDK just darkens the background when presenting a message. I think this looks better on a wider variety of apps

* Add Max Width Constraint

• To make in-app messages look better in landscape mode on most devices, I've added a max width constraint to top & bottom banner messages so that they don't take up most of the screen in landscape mode.

* Remove Height Observer

• Removes height observer from the webview, which is currently not being used.

* Add Viewed/Opened API Calls

• Adds API calls that get triggered whenever an in-app message is viewed or opened

* Fix Flaky Integration Test

• We have an integration test that initializes the SDK and waits for a mock HTTP response to the register API that has some in-app messages.
• It looks like for slower machines (ie. Travis VM's) our test timeout was set too low.
• Doubled the timeout to be 0.2 seconds.

* Add Integration Test

• Adds a test to make sure that when users tap an action on an in-app message, the correct impressions API call is triggered

* Change Endpoint Path

• Josh improved the API path for the in-app message API's, this commit changes the path the SDK uses and updates the Request unit tests to account for the difference

* Fix Flaky Integration Test

• A second timer-based integration test is a bit flaky on slower machines.
• This issue doesn't effect our unit tests since they don't depend on initializing the entire SDK and mocking API requests, but this integration test does
• On slower machines like Travis VM's, getting the SDK set up can add a bit of a delay.
• This commit changes an assertion to check to make sure a timer is set up to fire within 1 second of the 30 seconds required. Previously it was within 0.3 seconds, but slower machines tend to need a larger window.

* Implement Max Display Time Timer

• In-app messages can be set to dismiss after a certain amount of time is reached (max_display_time)
• This commit implements the max display time.

* iOS 11 Safe Area

• Previous commits were only using safe area layout guides in iOS 12. However the safe area anchors were added in iOS 11, so I've changed it to use safe area layout guides in iOS 11 as well.
• Adds some comments to clarify the message view controller
• Simplifies code to set up the dismissal timer, which was initialized using a local variable for previous debugging purposes.

* Remove SDK Version Trigger

• We've decided to implement SDK version triggers as an additional backend filtering mechanism, along with app-version.

* Add getTriggers Public Methods

• Adds public methods to the SDK called getTriggers() and getTriggerValueForKey() that returns currently set triggers. This is similar to getTags()

* Add Nullability Annotations

• We previously decided that moving forward, all new methods added to the iOS SDK would use nullability annotations to make using our SDK with Swift easier.
• This commit adds nullability specifiers to the in-app messaging methods.

* Fix Nullability Generics

• Fixes an issue with the previous commit where nullability specifiers were mistakenly added to generic types

* Fix Logic Error

• Fixes a trigger evaluation error where the != operator would return false if the local trigger value was "nil" and the trigger value was not nil.
• For example, if the app has never set a value for "prop1", but a message has a trigger with the condition "prop1" != 3, the SDK was previously returning FALSE even though logically this should return true.

* Add & Simplify Tests

• Simplifies some tests using an existing method that performs the same logical trigger evaluations
• Adds a test to make sure triggers evaluate correctly even when no local value has been saved for a given property.

* Fix Trigger Evaluation Order Issue

• Message triggers are evaluated in a specific order: the normal triggers are evaluated first and the time-based (dynamic) triggers are evaluated afterwards, only if all of the normal triggers evaluated to true. After all, there's no point in scheduling a timer for a message if it can't be shown even once the timer is finished.
• There was a problem with how the SDK was evaluating triggers: if a message had 1+ time-based triggers but the last trigger was a normal trigger that evaluated to true, the entire method would prematurely return true without even checking to see if the time-based triggers were valid
• Fixed by removing all return statements from the normal (non-dynamic) trigger evaluation loop, and created a simple boolean flag that indicates if the SDK should bother checking the time-based triggers.

* Change Operator String Values

• We've decided that instead of using symbol operator string values (ie. "==") we will instead use an existing string enumeration the backend was using for segment filters ("==" is now "equal" for example)
• Removes the "testTriggerIdentifier()" test since it is now planned that the backend will generate UUID's for triggers
• Most of our SDK doesn't use hardcoded string values for Trigger Operators (such as "not_equal"), but there were a few places that did use the hardcoded string values.
• Removed all occurrences of using hardcoded strings.

* Add Trigger ID's

• It's been decided that triggers for in-app messages will each have their own unique UUID's
• The SDK was previously generating a unique "id" for each trigger to avoid scheduling duplicate timers.
• This commit adds the "id" field to the Trigger model and replaces the previous heuristically generated ID's with the new trigger UUID

* Add Message Action

• Adds a new class (OSInAppMessageAction) that represents actions taken in in-app messages.
• The Action class will not be part of the OSInAppMessage instances directly. Instead, when a user taps a button, the JavaScript event will fire an event with the Action JSON that the SDK will decode as an OSInAppMessageAction instance.

* Trigger ID Assertion

• Adds an additional assertion to the test testCorrectlyParsedTriggers() that checks to make sure trigger ID's are being parsed correctly.

* Add Exact Time Trigger Tests

• Adds integration tests that verify that the "exact time" trigger for in-app messages is working correctly.
• Adds a test that checks to make sure "window" triggers work, which allow developers to schedule in-app messages that can only be shown for a certain window of time.

* Improve Tests

• Some of the in-app message integration tests could be shortened by moving some commonly used code into a separate function (code to take a single in-app message, and mock the registration JSON, then initialize the SDK)

* Message Actions

• Adds a new class (OSInAppMessageBridgeEvent) that represents messages sent from JavaScript in in-app messages.
• This allows the SDK to know when the page has finished rendering, and also lets it receive button click data as well.

* Fix PBXProj

• Added new header files in the previous commit but forgot to include the updated PBXProj

* Message View Limit

• This commit implements the "os_viewed_message" trigger that lets apps make sure a given in-app message can only be displayed X times
• Adds a test to make sure that the filter works correctly.

* Add Action Metadata

• Adds an 'additionalData' property to OSInAppMessageAction
• Updates the delegate method to give the full OSInAppMessageAction object to developers when an action occurs (was previously only giving them the actionID)
• Moves the interface for the OSInAppMessageAction to the OneSignal.h public header file
• Because this logic is so constrained to UI and JavaScript, we will need to record UI tests to test this functionality. But I did add tests to make sure that at least the JSON gets parsed correctly to build OSInAppMessageAction objects

* Adjust Project Structure

• Adjusts the source file groups to make in-app messaging a bit easier to navigate

* Fix Flaky Email Test

• Fixes a flaky email test that seems especially flaky now that we've added HTTP request API mocking

* Simplify Trigger Logic

• Simplifies the method that loops through OR and AND blocks of triggers to determine if a message should be shown
• Breaks the method up so that evaluating individual triggers happens in a separate method in the trigger controller and simply returns a boolean

* Fix Demo

• Fixes the demo project now that the operator JSON keys have changed (ie. "==" is now "equal")

* URL Change

• Changes the URL of the engagement request that gets fired when an in-app message action occurs

* Fix Tests

• The URL change in the previous PR broke some API request verification tests
• This commit fixes those tests to account for the new URL. Also removed an unnecessary messageID parameter from /engagement since it is already being sent in the path

* Fix Action Delegate Method

• Fixes old code that was sending using just the actionID string instead of the full OSInAppMessageAction object when firing the OSInAppMessageViewControllerDelegate method
• Fixes a typo in the OSInAppMessageViewControllerDelegate protocol

* Change Property Name

• In app messages sent in the response body for /on_session will use the key 'in_app_messages' instead of 'messages'.

* Add Variant ID

• We were previously going to use a field called content_id to get the correct variant of a message.
• However it has been decided that the client will pick the variant using the local ISO language code and device type.
• Added `variants` as a field of OSInAppMessage

* Data-Based HTTP Requests

• Our HTTP request structure doesn't currently allow for HTTP requests that receive something other than JSON
• This commit adds the concept of a data request that lets the SDK ask OneSignalClient to execute a request that returns arbitrary NSData
• This will be useful to let us load message HTML

* Add OSInAppMessageController

• Adds a new controller that is a category of OSInAppMessage, which allows the SDK to download in app message HTML

* Load Message Content

• Adds ability to load message HTML for a given variant and language
• Changes the SDK so that instead of using the preferredLanguage property of NSLocale, it instead loops through NSLocale's preferredLanguages array
• Adds tests to make sure that message HTML load requests are correctly formatted and return the correct HTML
• Tests also make sure that variant preference order is correct (platform takes precedence over language)

* Change Analytics Requests

• We've decided to make the URL structure consistent for in-app messaging API's so that it is always /api/v1/in_app_messages/{message_id}
• Adds variant_id as a parameter to all in-app messaging HTTP analytics requests (actions and views)

* Fix Missing Import

• This commit adds a missing header file import that broke the tests for the previous commit

* Add Ability to Disable In-App Messages

• It will likely be common for apps to want to disable in-app messages. To make this easy, I've added a public property developers can change to disable/enable in-app messaging.
• Adds tests to verify that in-app messages are not shown when disabled, and that the property (OneSignal.enableInAppMessages) is set to true by default, and is correctly persisted between sessions

* Full Screen Vertical Constraint

• Changes the layout constraints for full screen messages so that they correctly change dimensions when the device's orientation changes.
• Additionally adds some more comments and also refactored the OSInAppMessageViewController's setupInitialMessageUI() method so that it is easier to understand
• Commented out the loadMessageContent() method, which is responsible for loading the HTML for the message variant, since the backend implementation isn't currently available. Instead, the SDK currently loads some example/test URL's

* Fix ISO Language Code Issue

• NSLocale.preferredLanguages returns full language codes with regions (ie. "en-US"), however our SDK only supports two-character codes (ie. "en")
• Fixed by accessing only the first two characters of the language code

* Fix Retain Cycle

• Fixes an issue where the webview for in-app messages retains a strong reference to the script handler delegate, which caused the entire in-app message view controller to get leaked
• Fixed by adding a call to remove the script message handler when the message view is dismissed
• This commit also adds a check to make sure the variant ID is defined before attempting to present an in-app message, since a crash would otherwise occur

* Static Analysis Tweaks

• Fixes some minor complaints from a static analysis of the recent changes in the SDK

* Tablet Support

• Improves the look of in-app messages on tablet devices (iPad support) by adjusting the size of banners and modal messages

* JS IAM Bridge

• Builds out the bridge between iOS SDK and JavaScript for in-app messages
• Adds the ability for JavaScript to tell the SDK when the page has loaded, and changed how the SDK processes actions

* Preventing pinch zoom

* action_id to id since it is nested in action

* Now used the rendering_complete event to display

* Now using the rendering_complete event to display so we can do so from javascript to future puff for liquid templates support
* Added a TODO that we still need to pass some data to javascript before we try to load the page.

* Misc clean up and changing test values.

* Cleaned up display type and fixed IAM height

* Now sets height of IAM based on the value passed from JS.
   - Used for banners and modal.
   - Added OSInAppMessageBridgeEventRendingComplete to account for this message type
* Removed OSInAppMessageDisplayType, we only need position
* Cleaned up debugging static HTML pages and button callbacks from test app.
* Now displays IAMs without any triggers right away.
* Corrected webView call to run on the main thread.
   - [self.webView loadHTMLString:html baseURL:url];
* Corrected IAM get HTML request

* Fixed up unit tests

* Updated REST calls for impressions and clicks

* Updated to match the new spec defined in our RFC.

* Added UI to change app id for testing

* Just added this to the dev version of the test app, not the example app

* Fixed crash when tapping on message "X"

* Added SDK-Version HTTP header required for IAMs

* Add IAM Preview

* Interface changes to IAMs from previous work done already
* Banners now allow interaction with app behind them (don't take up full screen)
* Banners also do not dismiss on outside click and do not have a dark background
* Center modals and full screens take up entire screen and now have a scale intro animation instead of sliding
* Orientation changes are handled now, so the IAM only responds to landscape and portrait changes to and from
* Orientation change now hides the IAM and then reanimates the intro animation once the orientation is completely settled. This fixes the issue of seeing a background behind an image url while it is readjusting the messageView
* All IAMs now have corners and drop shadows for a better look
* Banners have a limited pan gesture Y and min/max dismiss time
* Other changes are constraint modifications, code cleanup, and commenting

* Removed clip bounds on IAM view on accident
* This is necessary so that during orientation change no strange UI issues are shown (blackouts)

* Interface changes to IAMs from previous work done already (#13)

* Interface changes to IAMs from previous work done already
* Banners now allow interaction with app behind them (don't take up full screen)
* Banners also do not dismiss on outside click and do not have a dark background
* Center modals and full screens take up entire screen and now have a scale intro animation instead of sliding
* Orientation changes are handled now, so the IAM only responds to landscape and portrait changes to and from
* Orientation change now hides the IAM and then reanimates the intro animation once the orientation is completely settled. This fixes the issue of seeing a background behind an image url while it is readjusting the messageView
* All IAMs now have corners and drop shadows for a better look
* Banners have a limited pan gesture Y and min/max dismiss time
* Other changes are constraint modifications, code cleanup, and commenting

* Removed clip bounds on IAM view on accident
* This is necessary so that during orientation change no strange UI issues are shown (blackouts)

* Add IAM Preview (#11)

* Add IAM Preview

* Fix click on image or button URL

* Fix IAM loading html blocking the user input (#12)

* Make sure dismiss animation works when showing new IAM preview (#14)

* Code cleanup and handling for dismissing current showing IAM
* When a preview IAM is incoming and a current IAM is showing, it will now be dismissed with its default animation off the screen and show the incoming preview IAM

* Added handling for Active and Resign Active state for IAM
* Some cases where this matters regard leaving the app from a button, body, or image click directing you to a browser. When dismissal is active, the current IAM will be dismissed and as you transition to the browser a new one (if queued) will try to show. When returning to the app from the browser in some cases, the IAM will be hidden and only show up when changing orientation of the phone (or other interface changes trigger UI refresh).
* Another case is panning the IAM and as it is panned somewhere other than the finalYConstraint and the user leaves the app, on returning to the app the IAM will stay in the previous panned location.
* Last case is leaving the app for a while and returning to the with an IAM on the screen. The URL for the IAM will reload in the WebView and cause the background to be shown.
* For all of these cases, the reanimation on reentry into the app solves these interface problems by basically resetting the IAM to what it would be if it just showed up into the app.

* Changed ResignActive observer to EnterBackground observer
* Found an issue where ResignActive was being triggered while pulling down notification tray
* EnterBackground is triggered when leaving the app, which is better scenario for resetting constraints for reentry animation

* Modified OSInAppMessage and add extra handling when showing IAM preview (#15)

* Modified OSInAppMessage and add extra handling when showing IAM preview
* Removed previewUUID and replaced it with isPreview BOOL
* Added handling for when a new IAM preview is sent, which dismisses the current IAM if there is one and shows the preview

* Cleanup for dismissing current IAM
* Added 2 new methods for dismissing current IAM so that direction and velocity are now defaulted in some cases

* Commit to fix iPhone X UI issues with IAM (#16)

* JS method getPageMetaData() crashes between JS and Objective C when trying to send over a DOMRect in the JSON. Changes were changed in backend and a PR has been created, once it is approved and merged the height can be adjusted for orientation changes.
* Methods created for webView adjustments during runtime so when orientation change occurs webView is removed from superview and fills screen and new height can be calculated using JS getPageMetaData(). Then the webView will be placed back inside the messageView with correct constraints set and height.
* Currently the method for handling new height calculation  during orientation change is commented out with a TODO until the JS code is updated to prevent crash.

* Add apns preview parse (#17)

* Add apns preview parse

* IAM dash stats (impressions and clicks), show IAM once, and js height update (#18)

* Two main concerns in this commit
1) First thing is the height update by calling the JS getPageMetaData() method
* JS method is called to get new height based on resized WebView
* During orientation change all constraints are removed from the messageView and it is hidden from the view
* Orientation change could cause the text in the IAM to not wrap as many lines, therefore the WebView is resized to height of the device and width (with margins accounted for)
* Then the new height can be obtained and passed back to the messageVie where a completion callback is used to set new constraints

2) Second thing is the dash stats and only showing IAMs once (after dismissed)
* Similar to Android we have 3 sets (impression, clicks, and seen)
* These sets are cached in user defaults after any successful events regarding impressions (displayed IAM), clicks (button, body, image), or seen (dismissed IAM)
* Impressions and clicks use onFailure and onSuccess completion blocks to determine whether or not the event was successfully logged as a dashboard stat with a POST
* Seen is tracked by simply caching any IAMs that have been dismissed and is handled in the dismiss callback of the IAM controller delegate

* Now moving on to creating unit tests for impressions, clicks, and seen events for IAMs

* Some comments and code cleanup

* Added broken out method for impressions on a IAM
* This will allow for easier unit tests in future since it keeps the logic away from any UI issues
* Deleted cache logic for setting the _messagingEnabled

* Custom triggers (#19)

* Fix triggers custom

  * OS-2408

* Codereview comment

* Squashed and merged dynamic triggers into this branch and now needs to be merged into js_bridge (#22)

* Two main concerns in this commit
1) First thing is the height update by calling the JS getPageMetaData() method
* JS method is called to get new height based on resized WebView
* During orientation change all constraints are removed from the messageView and it is hidden from the view
* Orientation change could cause the text in the IAM to not wrap as many lines, therefore the WebView is resized to height of the device and width (with margins accounted for)
* Then the new height can be obtained and passed back to the messageVie where a completion callback is used to set new constraints

2) Second thing is the dash stats and only showing IAMs once (after dismissed)
* Similar to Android we have 3 sets (impression, clicks, and seen)
* These sets are cached in user defaults after any successful events regarding impressions (displayed IAM), clicks (button, body, image), or seen (dismissed IAM)
* Impressions and clicks use onFailure and onSuccess completion blocks to determine whether or not the event was successfully logged as a dashboard stat with a POST
* Seen is tracked by simply caching any IAMs that have been dismissed and is handled in the dismiss callback of the IAM controller delegate

* Now moving on to creating unit tests for impressions, clicks, and seen events for IAMs

* Some comments and code cleanup

* Added broken out method for impressions on a IAM
* This will allow for easier unit tests in future since it keeps the logic away from any UI issues
* Deleted cache logic for setting the _messagingEnabled

* Work done on the TriggerController and DynamicTriggerController (#20)

* Work done on the TriggerController and DynamicTriggerController
* A lot of clean up on the TriggerController for inconsistent behavior surrounding caching triggers
* IAM originally planned to be shown X number of times and this logic was being implemented, counted, and cached. This is now removed also.
* Changed parsing behavior for DynamicTriggerController bridge to get the "property" key's value, which is incorrect and should be grabbing the "kind" key's value
* Added proper handling for dynamic trigger kinds "session_duration" and "min_time_since" for IAMs

Misc code clean up, commenting, within all of the IAM files. Just creates more consistency and removes old outdated logic to match Android behavior.

* Added property field back into Trigger class

* Making sure pausing IAM and click action handler are implemented (#21)

* Making sure pausing IAM and click action handler are implemented
* Previously pausing of IAM was called messageEnabled, this was inconsistent to Android and documentation. Also previous code was caching state of paused IAM, this is removed now and can only be set locally during app session defaulting back to false on app cold start up.
* Now click action handler has a setter which takes in a block similar to notification received and notification opened blocks
* Refactored code related to "messagingEnabled" now being refactored to "isInAppMessagingPaused"

* Unit test clean up for changes

* _isInAppMessagingPaused is synchronized
* Changed default setting by using the actual setter method "setInAppMessagingPaused()"

* Update OSMessagingController.h

* Iam merge issue fixes after triggers (#23)

* Fixing merging issues and inconsistencies after trigger work

* Merge caused property to be replaced by kind
* This is fixed now

* Added some new UI fields for IAM public methods to tests (#24)

* Field for pausing IAMs, removing trigger, getting trigger

Other code cleanup
* Merge caused trigger "kind" to replace "property". Fixed now and property value is working properly to show IAMs when triggers are satisfied
* Merge caused deletion of a few methods, but these issues are now fixed after looking at other commits before the merge

* Minor refactoring after merging (#26)

* Refactored pause in app messaging methods
* Changed color for demo app to red

* Fix tests on Dynamic triggers

* Added dismiss duration handling for IAMs (#27)

* Added dismiss duration handling for IAMs
* Payload comes along with max display time and this will be used to set a timer and hide the IAM after that timer reaches the time set

Excluding iOS 9 and older from seeing IAMs and disabled in focus notification for IAM preview
* When the app is in background notification will be shown by the OS so this will need to be fixed by excluding specific versions from being valid IAM preview test devices on dashboard UI

Also added better system version checking and updated all methods using old check

* Two minor fixes for IAM
* Fixed duplicate message issue when leaving the app while 2 or more IAMs are in the message display queue. Trigger an on_session and they will be added twice because of improper contains check.
* Notifications showing for previews while in focus in app fixed

* Fixes from comments
* Fixed DummyOSMessagingController selectors removal
* Fixed iOS version checking

* Fixes from comments
* Fixed iOS version checking

* UI issue slipped through the cracks
* When locking the device or leaving the app and changing orientation and then reopening the app the IAM would have unexpected erros

In cases of banners the WebView would be gone and sometimes the IAM would be hidden
* This was due to constraints being set when backgrounding the app and the WebView is now never taken out of its superview but instead constraints are removed and re-added when necessary

In cases of center modals and full screens the WebView would retain its previous size and not chnage to the correct orientation change constraints

Most of this was fixed by modifying what constraints we adjust when backgrounding or coming into active states in the app

* Merge from master version 021001 (#25)

* Merge from master version 021001

* Update OneSignal.h

* A lot of clean up to get all tests passing with this merge
* A lot of conflicts around version checking, where the test method was not overriding the version check method because it was refactored. This is now fixed though and fixed a lot of tests.
* iOS runs tests at random, so sometimes tests fail when run all together, but once run individually they pass. This will most likely involve something being reset in beforeEachTest method in future.
* Removed feature for runtime push notification payload modification allowing somebody to create a block and modify the payload if they want before showing it to the user receiving it.

* Removed trigger.jsonRepresentation
* Added this when I was testing something, but should not be here

* Changed pauseInAppMessaging to pauseInAppMessages

* Few minor updates (#30)

* OneSignalHelperOverrider only needs to swizzle greater than or equal method and removed unnecessary methods from .h and .m
* Changed NSLog to OneSignal log in update external id request

* Updated frameworks and version number (#31)

* Also updated action click handler to print all variables of action out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants