Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 14    Views: 106

mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
10/15/13 12:02 PM (12 years ago)

Parse Channel Subscriber Plugin released!

A new plugin has been released for purchase on the BTM Marketplace named "Parse Channel Subscriber" by buzztouch member feraco. DEMO VIDEO: http://www.youtube.com/watch?v=U3cC_ZouQDI PURCHASE: https://buzztouchmods.com/market (see "Parse Channel Subscriber") ** Be alerted earlier about new plugin releases on the BTM Marketplace, including updates, news and sales by subscribing! Send an email to [email protected] to subscribe! Thank you, David BTM Marketplace https://buzztouchmods.com/market
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
10/15/13 01:18 PM (12 years ago)
If anyone needs help I'm here to help.
 
epicweb
Aspiring developer
Profile
Posts: 159
Reg: Aug 30, 2012
Glen Carbon
4,990
like
10/15/13 02:06 PM (12 years ago)
Very nice... how difficult is parse to implement as compared to scringo or self hosted push? I have no luck with either of them but admit I need to spend more time trying to get it to work.
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
10/15/13 02:08 PM (12 years ago)
Parse has great tutorials. I am not a master coder and I just followed the parse tutorials.
 
Kaybee
buzztouch Evangelist
Profile
Posts: 659
Reg: Sep 22, 2012
Perth, Australi...
44,690
like
10/15/13 07:32 PM (12 years ago)
Man I have been waiting for this, really valuable plugin for us guys, last you want to do is bother people with Push notifications that arent relevant to them. Feraco has some good notes that I used before, not sure if he has updated them yet. It is pretty simple, only this is to not clash with other codes already in package about push notifications. Thanks Feraco !!
 
Kaybee
buzztouch Evangelist
Profile
Posts: 659
Reg: Sep 22, 2012
Perth, Australi...
44,690
like
10/16/13 08:03 AM (12 years ago)
Not sure where to put this is it is technically not a BT plugin, but anyway I try load the "PArse" screen and get bombed out with this error: From Debugger below: **edited** Thanks
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
10/16/13 08:42 AM (12 years ago)
Send me your package
 
Kaybee
buzztouch Evangelist
Profile
Posts: 659
Reg: Sep 22, 2012
Perth, Australi...
44,690
like
10/16/13 08:46 AM (12 years ago)
Sent it now, thanks
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
10/16/13 12:42 PM (12 years ago)
Hey I got it working. I changes your app delegate file by adding this to the and covering up some of the bt push code. I copy and pasted tis up where it says /* loadAppData... Also You need to add the channels in your control panel so that the json is responding to the code. If you do not add channels then it will crash. I will send it back. //didFinishLaunchingWithOptions... -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ [Parse setApplicationId:@"YOURID" clientKey:@"YOURKEY"]; // Register for push notifications [application registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound]; /* Debugging Output --------------------------------------------------------------------------- Set showDebugInfo to TRUE to print details to the console. To see the console, choose Run > Show Console while the simulator or a connected device is running. Nearly every method has output to show you details about how the program is executing. It looks like lots of data (it is), but it's very useful for understanding how the application is behaving. */ //show debug in output window? [self setShowDebugInfo:true]; /* Application Configuration File / Data --------------------------------------------------------------------------- One file holds all the configuration data associated with the application. This file must exist in the applications bundle (drag it into Xcode if it's not already there). This file is normally named BT_config.txt and can be read / edited with a normal text editor. If this configuration data uses a dataURL, a remote server will be polled for content changes. Changes will be downloaded and saved locally. Once this happens, the BT_config.txt file is no longer used and instead the application refers to it's newly downloaded and cached data. In other words, if a dataURL is used then the configuration file in the Xcode project is only referenced so it can find the buzztouchAppId, buzztouchAPIKey, and dataURL. After that, it uses the data that was saved from the URL. If no dataURL is provided, the file in the bundle will be read and parsed everytime the app is started. */ //use a saved config file name if it exists... NSString *tmpConfigFileName = [BT_strings getPrefString:@"configToUse"]; if([tmpConfigFileName length] > 5){ [BT_debugger showIt:self theMessage:@"Using a non-default configuration file."]; [self setConfigurationFileName:tmpConfigFileName]; }else{ [BT_debugger showIt:self theMessage:@"Using the default BT_config.txt."]; [self setConfigurationFileName:@"BT_config.txt"]; } //initialize a temporary buzztouch app object to assign to the rootApp property... BT_application *tmpApp = [[BT_application alloc] init]; //initialize a temporary window to assign to the window property... UIWindow *tmpWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [self setWindow:tmpWindow]; [tmpWindow release]; //assign the local app property... [self setRootApp:tmpApp]; [tmpApp release]; //make the window active... [self.window makeKeyAndVisible]; //init audio player in background thread... [NSThread detachNewThreadSelector: @selector(initAudioPlayer) toTarget:self withObject:nil]; //load sound effect players in background thread... [NSThread detachNewThreadSelector: @selector(loadSoundEffects) toTarget:self withObject:nil]; //load the applications data... [self loadAppData]; //monitor shake gestures in UIViewControllers... application.applicationSupportsShakeToEdit = YES; //return return TRUE; } //didRegisterForRemoteNotificationsWithDeviceToken... - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken { // Store the deviceToken in the current installation and save it to Parse. PFInstallation *currentInstallation = [PFInstallation currentInstallation]; [currentInstallation setDeviceTokenFromData:newDeviceToken]; [currentInstallation saveInBackground]; } //unRegisterForPushNotifications... -(void)unRegisterForPushNotifications{ //look for last token... NSString *deviceToken = [BT_strings getPrefString:@"lastDeviceToken"]; [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"unRegisterForPushNotifications Device Token: %@", deviceToken]]; //if we have a token, and a register it... if([deviceToken length] > 1 && [[self.rootApp registerForPushURL] length] > 1){ //clean up token... deviceToken = [deviceToken stringByReplacingOccurrencesOfString:@"<"withString:@""]; deviceToken = [deviceToken stringByReplacingOccurrencesOfString:@">"withString:@""]; deviceToken = [deviceToken stringByReplacingOccurrencesOfString:@" "withString:@""]; //erase last token... [BT_strings setPrefString:@"lastDeviceToken" valueOfPref:@""]; //append deviceToken and deviceType and apnCommand to end of URL... NSString *useURL = [[self.rootApp registerForPushURL] stringByAppendingString:[NSString stringWithFormat:@"&deviceType=%@", @"ios"]]; useURL = [useURL stringByAppendingString:[NSString stringWithFormat:@"&apnCommand=%@", @"unregisterDevice"]]; useURL = [useURL stringByAppendingString:[NSString stringWithFormat:@"&deviceToken=%@", deviceToken]]; //append currentMode ("Live" or "Design") to end of URL... useURL = [useURL stringByAppendingString:[NSString stringWithFormat:@"&currentMode=%@", [self currentMode]]]; //merge environment variables in URL... useURL = [BT_strings mergeBTVariablesInString:useURL]; //escape the URL... NSString *escapedUrl = [useURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //tell the BT_device to unRegister on the server (the device class makes the URL request)... [BT_device unRegisterForPushNotifications:escapedUrl]; } } //didFailToRegisterForRemoteNotificationsWithError... -(void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didFailToRegisterForRemoteNotificationsWithError: ERROR: %@", error]]; } //didReceiveRemoteNotification.. - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [PFPush handlePush:userInfo]; } //playSoundFromPushMessage... -(void)playSoundFromPushMessage:(NSString *)soundEffectFileName{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"playSoundFromPushMessage: %@", soundEffectFileName]]; NSString *theFileName = soundEffectFileName; if([BT_fileManager doesFileExistInBundle:theFileName]){ NSURL *soundFileUrl = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], theFileName]]; NSError *error; AVAudioPlayer *tmpPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileUrl error:&error]; if(!error){ [tmpPlayer setNumberOfLoops:0]; [tmpPlayer prepareToPlay]; [tmpPlayer play]; [tmpPlayer release]; }else{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didReceiveRemoteNotification soundEffectPlayer ERROR: %@", [error description]]]; } } }
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
01/09/14 09:11 AM (11 years ago)
This plugin does not seem to work for BT 3.0? Any chance it can be updated, as I unfortunately just bought it in the hope it will work.
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
01/09/14 09:18 AM (11 years ago)
I am working on an update. Hopefully I will be able to update soon.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
01/09/14 09:30 AM (11 years ago)
That sounds good. If there is any chance this can be done without the control panel already, I would take it too ;-) Last piece of the puzzle for my client, so hope you find a solution soon :-)
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
01/13/14 05:55 AM (11 years ago)
@Feraco: Can you maybe let me know if you will get it done this week? No problem if not, but just nice to know as I would implement something different then.
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
01/13/14 10:39 AM (11 years ago)
Im hoping this week but Im not sure if it will be. I will contact you when updated.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
01/13/14 10:46 AM (11 years ago)
Ok will wait for you till friday then :-)
 

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.