Handling Push Notifications when App is Terminated

1) When application is running in background and When application is running in foreground application:didReceiveRemoteNotification: method will called as below. – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { if (application.applicationState == UIApplicationStateInactive) { // opened from a push notification when the app was on background NSLog(@”userInfo->%@”, [userInfo objectForKey:@”aps”]); } else if(application.applicationState == UIApplicationStateActive) { // a push … Read more

Scheduled websocket push with Springboot

Before starting, make sure that you have the websocket dependencies in your pom.xml. For instance, the most important one: <dependency> <groupId>org.springframework</groupId> <artifactId>spring-websocket</artifactId> <version>${org.springframework-version}</version> </dependency> Then, you need to have your configuration in place. I suggest you start with simple broker. @Configuration @EnableWebSocketMessageBroker public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { @Override public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoint(“/portfolio”).withSockJS(); … Read more

Play local notification default sound when displaying UIAlertView?

Good question. Ideally, there would be a way of selecting a system sound using AudioServices. However, the following statement from Apple’s “System Sound Services Reference” suggests otherwise: In Mac OS X, when a user has configured System Preferences to flash the screen for alerts, or if sound cannot be rendered, calling this function will result … Read more