Search code examples
iosunity-game-enginepush-notificationpushwoosh

Changing parameters for Pushwoosh in iOS or Unity


I am trying to alter the PushNotificationManager.h to change some settings, like I don't want pushes to be received when app is in foreground.

Here is what I have tries:

- (void) registerForPushNotifications;
[PushNotificationsManager sharedManager].showPushnotificationAlert = NO; 

This creates this alert:

*Expected identifier or ”(“*

Then I tried this:

- (void) registerForPushNotifications(){
    [PushNotificationsManager sharedManager].showPushnotificationAlert = NO;
}

This creates this alert:

*Expected ";" after method prototype*

Then this:

- (void) registerForPushNotifications([PushNotificationsManager sharedManager].showPushnotificationAlert = NO);

Also this throws the same error. What am I doing wrong.

Hoping for help in this matter. I am novice in the XCode part. I build everything from the Unity.


Solution

  • I see you are referring to this file:
    https://github.com/Pushwoosh/pushwoosh-sdk-samples/blob/master/Unity/iOS/Plugins/iOS/UnityRuntime.m

    This is how you should modify the file:

    void registerForRemoteNotifications() {
        [PushNotificationManager pushManager].showPushnotificationAlert = NO;
        [[PushNotificationManager pushManager] registerForPushNotifications];
    }
    

    Do not change PushNotificationManager.h file! Hope this helps!