Discussion Forums  >  Self Hosted Control Panels

Replies: 15    Views: 184

SrikarSree
Aspiring developer
Profile
Posts: 79
Reg: Jul 22, 2012
Bangalore
7,090
07/20/13 10:26 AM (12 years ago)

Cannot read full message of the Push Notifications

Hi I have a few apps where the push notifications is enable using GCM through BT. What i find is that whenever i send a message, the message is delivered but cannot read the full message. If i click on the message it loads the app and not the message. Is there anyway to view or read the full message before it loads the app or even without loading the app. thanks in advance
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
07/20/13 12:37 PM (12 years ago)
I have this same problem, mine only displays one line of text. You could create a splash screen that loads from a URL with text on it that you could change out when you send a push notification. Jake
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/20/13 12:59 PM (12 years ago)
It requires no more than 15 lines of code. To add an alert view for when the app is launched to display the full message. Unfortunately I'm at a wedding so haven't got access to Xcode
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
07/20/13 01:02 PM (12 years ago)
The push message should display all of it when you scroll down on the device, like on the home screen on the device. IOS or Android? LA
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/20/13 01:12 PM (12 years ago)
Not if its a banner notification only if its set to an alert. Default is banner I think
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
07/20/13 01:19 PM (12 years ago)
True! LA
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/20/13 02:54 PM (12 years ago)
Seriously Kittsy? Checking the forums while at a Wedding? ;) Cheers! -- Smug
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/21/13 02:00 AM (12 years ago)
Weddings are bloody boring
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/21/13 06:29 AM (12 years ago)
Here we go in your app delegate find //didReceiveRemoteNotification.. -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didReceiveRemoteNotification %@", @""]]; //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){ NSString *alertMsg; NSString *badge; NSString *sound; //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]; } } and replace it with this -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didReceiveRemoteNotification %@", @""]]; //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){ NSString *alertMsg; NSString *badge; NSString *sound; //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([application applicationState] == UIApplicationStateInactive) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert show]; [alert release]; } } this will now show the sent message when the app is accessed by pressing the notification. Also it now shows the push notification message when the app is active
 
SrikarSree
Aspiring developer
Profile
Posts: 79
Reg: Jul 22, 2012
Bangalore
7,090
like
07/21/13 10:42 PM (12 years ago)
@kittsy thank you for the time taken to provide the code :-), however my apps are Android based. Can you please provide the code for android apps or how to use this into android. @LA, Since my apps android based and yes, i even scrolled the home screen but only few words are displayed but not all. Then when i click on the message it loads the app and it never displays the message.
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
10/01/13 10:32 AM (12 years ago)
Hey SrikarSree I use xtify for push notifications for buzztouch 3.0. Its free to sign up and you have lots of options to choose from for push. If you need help. I have a tutorial also. I haven't. Really dived into push from buzztouch panel. Maybe ill take a look today!
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
10/01/13 02:11 PM (12 years ago)
Hey SrikarSree I use xtify for push notifications for buzztouch 3.0. Its free to sign up and you have lots of options to choose from for push. If you need help. I have a tutorial also. I haven't. Really dived into push from buzztouch panel. Maybe ill take a look today!
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
10/01/13 02:12 PM (12 years ago)
Sorry! I hit refresh.
 
SrikarSree
Aspiring developer
Profile
Posts: 79
Reg: Jul 22, 2012
Bangalore
7,090
like
10/02/13 03:49 AM (12 years ago)
@Cookup, Thanks for your info, i think xtify is a paid service. Anywho can you share the tutorials on this. It will of great help and thanks in advance.
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
05/11/14 10:56 AM (11 years ago)
Can this be updated for iOS core 3?
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
05/11/14 11:07 AM (11 years ago)
I figured it out.
 

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.