Skip to content

Instantly share code, notes, and snippets.

@weswit-team
Created January 9, 2018 17:52
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/d4bf51c75942c0fe120af4835fefe067 to your computer and use it in GitHub Desktop.
Save weswit-team/d4bf51c75942c0fe120af4835fefe067 to your computer and use it in GitHub Desktop.
for (LSMPNSubscription *mpnSubscription in _client.MPNSubscriptions) {
if ([_item isEqualToString:mpnSubscription.itemGroup]) {
// Subscription found, copy it and add a trigger expression
LSMPNSubscription *copy= [[LSMPNSubscription alloc] initWithMPNSubscription:mpnSubscription];
copy.triggerExpression= @"Double.parseDouble(${last_price}) > 100.0";
// Modify the subscription on the Server
[_client subscribeMPN:copy coalescing:NO]; // When modifying the coalescing flag is ignored
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment