Discussion Forums  >  Self Hosted Control Panels

Replies: 9    Views: 116

BandO
I hate code!
Profile
Posts: 153
Reg: Jan 23, 2012
Manhattan
1,530
05/14/13 03:15 AM (12 years ago)

Push to Specific Page

Is there way to send a push AND open to a custom/specific page? For example send out a push regarding breaking news, then I'm assuming it he BT control panel set the corresponding page in the app as the "launch page" and show that content. I realize this would be more a plugin. Is purpose would be to highlight certain "new" content without having to change the default layout..
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/14/13 06:26 AM (12 years ago)
You might think about Jakes solution, unless you need Android too. https://www.buzztouch.com/plugins/plugin.php?pid=4A71B334AF77045EBA8E3BD Cheers! -- Smug
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/14/13 07:41 AM (12 years ago)
If you mean Push Notification, then Parse is the best option. The built-in BuzzTouch push notification does not have the capability of launching a specific screen within the App. -- Niraj
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/14/13 12:22 PM (12 years ago)
You can do anything if you want to. Boundaries go to your app delegate from line 217 replace the whole method with this //didReceiveRemoteNotification.. -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didReceiveRemoteNotification %@", @""]]; NSString *alertMsg; NSString *badge; NSString *sound; //sound... if([[userInfo objectForKey:@"aps"] objectForKey:@"sound"] != NULL){ sound = [[userInfo objectForKey:@"aps"] objectForKey:@"sound"]; } //don't do anything if the app is not in the foreground. iOS handles inbound APNS message when app is in the background... if(application.applicationState == UIApplicationStateActive){ //alert message... if([[userInfo objectForKey:@"aps"] objectForKey:@"alert"] != NULL){ alertMsg = [[userInfo objectForKey:@"aps"] objectForKey:@"alert"]; } //badge... if([[userInfo objectForKey:@"aps"] objectForKey:@"badge"] != NULL){ badge = [[userInfo objectForKey:@"aps"] objectForKey:@"badge"]; } //sound... if([[userInfo objectForKey:@"aps"] objectForKey:@"sound"] != NULL){ sound = [[userInfo objectForKey:@"aps"] objectForKey:@"sound"]; } //if we have a sound... if([sound length] > 1){ [self performSelector:@selector(playSoundFromPushMessage:) withObject:sound afterDelay:.1]; } //show messsage... UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:alertMsg delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", "OK") otherButtonTitles:nil]; [alert show]; [alert release]; }else{ if([sound length] > 1){ //appDelegate yourApp_appDelegate *appDelegate = (yourApp_appDelegate *)[[UIApplication sharedApplication] delegate]; //load new screen BT_item *mynextScreen = [appDelegate.rootApp getScreenDataByNickname:sound]; [BT_viewControllerManager handleTapToLoadScreen:nil theMenuItemData:nil theScreenData:mynextScreen]; } } } In your push notification control panel just use your Sound Effect (ios only) box and type the NICKNAME of the desired screen name you want loading on push. And your good to go. I want sound winge winge winge, well the default sound still works but if that really is a problem maybe name your sound file the same as your nickname. Keep the faith Kittsy is here lol. I haven't overly tested but it works on my efforts and if David adds the url option this stuff gets even easier.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/14/13 12:23 PM (12 years ago)
Ps don't forget to change the appdelegates to your app name
 
BandO
I hate code!
Profile
Posts: 153
Reg: Jan 23, 2012
Manhattan
1,530
like
05/14/13 01:18 PM (12 years ago)
Thanks a million, I will keep you updated.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/14/13 01:21 PM (12 years ago)
Well it will Save you going somewhere else for push
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/14/13 01:57 PM (12 years ago)
Apologies here is a better method. the other version will launch a blank screen if you mistype the nickname, this version will just ignore it if it isn't a valid screen nickname. The other version will work, but this catches human error (Always room for improvement) //didReceiveRemoteNotification.. -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didReceiveRemoteNotification %@", @""]]; NSString *alertMsg; NSString *badge; NSString *sound; //sound... if([[userInfo objectForKey:@"aps"] objectForKey:@"sound"] != NULL){ sound = [[userInfo objectForKey:@"aps"] objectForKey:@"sound"]; } //don't do anything if the app is not in the foreground. iOS handles inbound APNS message when app is in the background... if(application.applicationState == UIApplicationStateActive){ //alert message... if([[userInfo objectForKey:@"aps"] objectForKey:@"alert"] != NULL){ alertMsg = [[userInfo objectForKey:@"aps"] objectForKey:@"alert"]; } //badge... if([[userInfo objectForKey:@"aps"] objectForKey:@"badge"] != NULL){ badge = [[userInfo objectForKey:@"aps"] objectForKey:@"badge"]; } //sound... if([[userInfo objectForKey:@"aps"] objectForKey:@"sound"] != NULL){ sound = [[userInfo objectForKey:@"aps"] objectForKey:@"sound"]; } //if we have a sound... if([sound length] > 1){ [self performSelector:@selector(playSoundFromPushMessage:) withObject:sound afterDelay:.1]; } //show messsage... UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:alertMsg delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", "OK") otherButtonTitles:nil]; [alert show]; [alert release]; }else{ //appDelegate yourApp_appDelegate *appDelegate = (yourApp_appDelegate *)[[UIApplication sharedApplication] delegate]; //load screen from push notification BT_item *mynextScreen = [appDelegate.rootApp getScreenDataByNickname:sound]; BT_item *screenObjectToLoad = nil; if([sound length] > 1){ screenObjectToLoad = [appDelegate.rootApp getScreenDataByNickname:sound]; } //load next screen if it's not nil if(screenObjectToLoad != nil){ ////leave alone [BT_viewControllerManager handleTapToLoadScreen:nil theMenuItemData:nil theScreenData:mynextScreen]; }else{ //show error alert [BT_debugger showIt:self theMessage:@"Invalid nickname"]; } } }
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/14/13 06:36 PM (12 years ago)
Nice work Kittsy! You sparked an idea ... We could use the sound field to be a query parameter for a URL lookup, which would load that unique content into an HTML screen or into a custom-built screen! What would that code look like? Would the "unique content" be loaded into theScreenData ? -- Niraj
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
05/15/13 03:41 AM (12 years ago)
Sweet Kittsy. This motivates me to try push on my server Nice work
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.