Monday, November 25, 2013

How To Integrate Parse With iOS App

This post is to discuss on Integrating Parse with iOS app. If you are planning to create a fresh iOS project with Parse then download the Starter project here. If you want integrate the Parse with an existing iOS app, then please go through the steps below.

Step 1. Parse SignUp
Step 2. Move to Dashboard
Step 3. Create a New App
Step 4. Copy Application ID, Client Key and REST API Key to a text file.

Open your iOS application and paste the following code in the didFinishLaunchingWithOptions method of AppDelegate.m

  [Parse setApplicationId:@"Your_App_Id" clientKey:@"Your_Client_Key"];  

Our method looks as follows. Don't forget to replace the placeholder with your App Id and Client Key :)

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions  
 {  
   [Parse setApplicationId:@"Your_App_Id" clientKey:@"Your_Client_Key"];  
   return YES;  
 }  

Add following code to the top of AppDelegate.m file.
 #import <Parse/Parse.h>  

Now we should download the Parse iOS SDK and add the Parse framework to our project. Also add the following libraries to the iOS project.
  • AudioToolbox.framework   
  • CFNetwork.framework    
  • SystemConfiguration.framework
  • CoreGraphics.framework  
  • CoreLocation.framework    
  • MobileCoreServices.framework    
  • QuartzCore.framework    
  • Security.framework    
  • StoreKit.framework     
  • libz.1.1.3.dylib   

Run your project and make sure there is no errors.
Login to your Parse account and goto the DataBrowser tab to check your back-end data.

Done :)

Friday, November 22, 2013

Tizen the new mobile OS !!!

The new Tizen mobile operating system is supported by Samsung and now a Tizen smartphone bearing model number SC-03F has come to light.

Most mobile phone users have never heard of Tizen.  Tizen is a project within the Linux Foundation and is governed by a Technical Steering Group (TSG) composed of Samsung and Intel. Samsung has already allocated USD $4 million towards the development of various apps from developers.

Tizen allows developers to program in HTML5, CSS, and Javascript) for its upcoming smartphone
Samsung has already allocated USD $4 million towards the development of various apps from developers (Tizen allows developers to program in HTML5, CSS, and Javascript) for its upcoming smartphone.

Read more at: http://www.firstpost.com/tech/samsung-tizen-and-the-internet-of-things-revolution-1233687.html?utm_source=ref_article
Samsung has already allocated USD $4 million towards the development of various apps from developers (Tizen allows developers to program in HTML5, CSS, and Javascript) for its upcoming smartphone.

Read more at: http://www.firstpost.com/tech/samsung-tizen-and-the-internet-of-things-revolution-1233687.html?utm_source=ref_article

Company / developer  :   Linux Foundation, Tizen Association, Samsung, Intel

OS family  :   Linux

Source model     Operating system: Open-source

SDK: Closed-source

Initial release :  January 5, 2012

Target Device :     PCs, tablets, smartphones, GPS smartnav, in-vehicle infotainment, smart TV

Available programming languages(s) :  HTML5, C, C++

Package manager :  RPM Package Manager

Supported platforms :  ARM and x86

Kernel type :  Monolithic (Linux)

Default user interface : Graphical (Native and Web applications)

License Operating system :  GPLv2, LGPL, Apache License, BSD, Flora License

SDK : Freeware

Official website :    www.tizen.org

Friday, November 15, 2013

Sending a PHP Curl requests to REST API of Parse.com

Parse is an external BaaS (Backend as a service) provider.

The REST API of Parse lets you interact with Parse from anything that can send an HTTP request. Read more about Parse Rest API.

Follow the steps to create a Parse App and obtain AppId.

1. SignUp for Parse
2. Move to Dashboard
3. Create a New App
4. Copy Application ID, Client Key and REST API Key to a text file.

Following is a sample code to send a Php Curl request to Rest API of Parse.  Replace the placeholders with your Application ID and Rest API Key in the code and run it from a php server.

 <?php  
 $url = 'https://api.parse.com/1/classes/GameScore';  
 $appId = 'YOUR_APP_ID';  
 $restKey = 'YOUR_REST_KEY';  
 $headers = array(  
   "Content-Type: application/json",  
   "X-Parse-Application-Id: " . $appId,  
   "X-Parse-REST-API-Key: " . $restKey  
 );  
 $objectData = '{"name":"Adarsh", "age":"26"}';  
 $rest = curl_init();  
 curl_setopt($rest,CURLOPT_URL,$url);  
 curl_setopt($rest,CURLOPT_POST,1);  
 curl_setopt($rest,CURLOPT_POSTFIELDS,$objectData);  
 curl_setopt($rest,CURLOPT_HTTPHEADER,$headers);  
 curl_setopt($rest,CURLOPT_SSL_VERIFYPEER, false);  
 curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);  
 $response = curl_exec($rest);  
 echo $response;  
 print_r($response);  
 curl_close($rest);  
 ?>  


Goto the Data Browser tab of the parse to find the saved data :)