Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 19    Views: 93

thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
03/04/14 07:11 AM (10 years ago)

Can Push Notifications Once clicked take you to BT Screen ?

i have been using BT push notifications for a long time. As it appears on notification screen you are allowed to click on it and APP opens. However i would like it to take you to specific BT screen ! Would this be possible and what is the best approach. help appreciated. thanks Alan
 
jjj0923
Aspiring developer
Profile
Posts: 36
Reg: Jan 07, 2014
Baltimore
6,610
like
03/04/14 07:22 AM (10 years ago)
thegibcoyote - we re interested in how you got push notifs to work - would you mind sharing information?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/04/14 08:40 AM (10 years ago)
Alan will the push notification go to a different screen depending on the push notification or will every push notification lead to the same screen
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
03/04/14 08:42 AM (10 years ago)
Kittsy same screen every time as it will be a html linked screen which can have the info changed when I create new notification. Is it easy to implement ?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/04/14 08:45 AM (10 years ago)
very simple, when I get home I will post the code
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/04/14 08:46 AM (10 years ago)
will be about 2 hours
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
03/04/14 08:56 AM (10 years ago)
Thanks mate
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
03/04/14 11:26 AM (10 years ago)
Kittsy anything he he he ?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/04/14 11:33 AM (10 years ago)
just setting up my environment don't wanna give you a bum steer
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
03/04/14 11:41 AM (10 years ago)
he he he appreciate it mate
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/04/14 12:49 PM (10 years ago)
apologies for the lateness had a bit of a nightmare setting the profile anyway in the app delegate find this //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]; }//in foreground... [[self getViewController] loadScreenWithItemId:@"5E79C357E15C774C1BE361B"]; << Add this } replace 5E79C357E15C774C1BE361B with the screen id you want to load jobs a good un. told you it was simple just didn't want to blind guess it and confuse you
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
03/04/14 12:59 PM (10 years ago)
Kittsy appreciate the support will run through it an test and revert on success rate on my app. Thanks mate
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/04/14 01:09 PM (10 years ago)
it's only one line of code piece of cake
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/04/14 03:29 PM (10 years ago)
Alan this has lead to some serious procrastination on my part, while I am meant to be completing uni work. The code above will work basically just add this line at the end of the above method. If you don't have all the code above in that method it doesn't matter I added that so you could see a pop up alert when the app was open. I will have a tutorial tomorrow on how to change the control panel to change the which screen is loaded on each push notification. A couple of lines of iOS code, 2 php files swapped and one row added to mysql I will dedicate it to you as my muse lol
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
08/09/14 10:57 PM (10 years ago)
Just found this thread. Sounds like it might be the start of something I had wanted to try :) Is the post from 3/4 missing an image or text? Kittsy is there a link for the tutorial? Thanks!
 
hasher13
Android Fan
Profile
Posts: 376
Reg: Jul 21, 2012
Wethersfield
8,060
like
12/18/14 07:57 AM (9 years ago)
Hi Kittsy, I have been looking for this solution for a long time and thank you for scripting it out. I see the above code is for iOS and was wondering if it is the same or need to do something different for Android. Right now I am only publishing Android apps. Thank you in advance. Howard
 
hasher13
Android Fan
Profile
Posts: 376
Reg: Jul 21, 2012
Wethersfield
8,060
like
12/20/14 10:53 AM (9 years ago)
Sorry to ask another question, but where would I find the "app delegate"? Thank you, Howard
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/20/14 11:49 PM (9 years ago)
The app delegate file is in the Bt_config group (looks like a folder) within Xcode. -- Niraj
 
hasher13
Android Fan
Profile
Posts: 376
Reg: Jul 21, 2012
Wethersfield
8,060
like
12/21/14 06:59 AM (9 years ago)
Hi Niraj, so this is only for iOS? Is there something for Android?
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/21/14 11:12 AM (9 years ago)
For Android, I suggest creating a new post asking specifically that question.
 

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.