Skip to content

Instantly share code, notes, and snippets.

@weswit-team
Last active April 28, 2023 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weswit-team/8db05c2ecf30af3398a9e381c763db3c to your computer and use it in GitHub Desktop.
Save weswit-team/8db05c2ecf30af3398a9e381c763db3c to your computer and use it in GitHub Desktop.
- (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