Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
- (void) connectAndRegister:(LSMPNDevice *)device {
// Create the LSLightstreamerClient and start connection
_client= [[LSLightstreamerClient alloc] initWithServerAddress:PUSH_SERVER_URL adapterSet:ADAPTER_SET];
[_client connect];
[_client addDelegate:self];
// Add device listener and start registration
[device addDelegate:self];
[_client registerForMPN:device];
}
#pragma mark - LSMPNDeviceDelegate
- (void) mpnDeviceDidRegister:(nonnull LSMPNDevice *)device {
// Registration succeeded
}
- (void) mpnDevice:(nonnull LSMPNDevice *)device didFailRegistrationWithErrorCode:(NSInteger)code message:(nullable NSString *)message {
// Registration failed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment