The problem should be this line
instead of
if (inAppAlertsPassed || inAppAlertsPassed) {
should be
if(inAppAlertsPassed || inFocusDisplayPassed) {
but there is another problem.
if the execution does not enter in this if block, there is no else case for if(inAppAlertsPassed || inFocusDisplayPassed) { and default value is to display the InApp alert.
It would be nice to have some Unit tests for this.
P.S. also they are displayed twice
Workaround is to set the value explicitly after init
[OneSignal setInFocusDisplayType:OSNotificationDisplayTypeNone];
@ogres Thanks for the details. Just fixed this with commit 301338eb2695f7d0090a40e5ad98fe7b72802021 and added a unit test too.
You can actually call the following instead as inFocusDisplayType is a static property on the OneSignal class.
OneSignal.inFocusDisplayType = OSNotificationDisplayTypeNone;
It can also be called anytime before or after OneSignal initWithLaunchOptions.
I am not sure I understand your P.S. comment "also they are displayed twice". Are you seeing the alert 2 times in your app? Are you also displaying your own alert from a open / received event?
Thanks.
@ogres Fix released in 2.5.2.