Initialize the object of Pusheo as follows:
Pusheo *pusheo;
pusheo=[[Pusheo alloc] init];
a. Normal Mode : ‘subscribe’ key and ‘publish’ key both are required. In this mode, you can PUBLISH as well as RECEIVE messages.
[pusheo initializeWithServerUrl:@"http://SERVER_IP:8080" publishKey:@"123" subscribeKey:@"123"];
b. Subscribe-only Mode : ‘publish’ key not required (Pass publish_key as @""
or nil
). In this mode, you can ONLY RECEIVE messages but you CANNOT PUBLISH messages to any channel. History will be available.
[pusheo initializeWithServerUrl:@"http://SERVER_IP:8080" publishKey:@"" subscribeKey:@"123"];
c. Publish-only Mode : Subscribe key and publish key both are required. In this mode you can publish messages but you CANNOT RECEIVE MESSAGES. History will NOT be available.
[pusheo initializeWithServerUrl:@"http://SERVER_IP:8080" publishKey:@"123" subscribeKey:@"123"];
- You can configure this object for ‘LostMessageCalls’ as follows:
- If you don’t configure, the default options are automatically used. By default, ‘LostMessageCalls’ are active with an interval of 20 seconds.
[pusheo periodicHistoryCall:YES interval:10];