Reputation: 2325
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.
Upvotes: 0
Views: 146
Reputation: 2121
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!
Upvotes: 2
Reputation: 64477
The semicolon at the end needs to go (it's the method implementation, not its @interface declaration where the semicolon would be necessary):
- (void) registerForPushNotifications;
So it becomes this:
- (void) registerForPushNotifications {
[PushNotificationsManager sharedManager].showPushnotificationAlert = NO;
}
Needless to say, this isn't legal Objective-C either, it's a mash of Objective-C and C syntax:
- (void) registerForPushNotifications(){
Upvotes: 0