May 19th, 2010 |
Published in
Drupal, Javascript, MySQL, PHP, Titanium, iPhone | 3 Comments
So I’ve built my first Drupal connected iPhone application. It uses the services module and authentication. I couldn’t find any code examples of using authentication online anywhere so I am including some code examples in this post in hopes that it will help someone else.
Firstly, I followed the tutorial I found in the CivicActions blog, and after I saw how to use the code to connect to a web service, I decided to look for how to use authentication, since the website I am building an app for uses authentication for the web services.
I used the suggested JS SHA256 library in the CivicActions tutorial, and came up with the method to use it properly while communicating with the services module.
Here is the code you’ll need, keep in mind this is using Titanium Developer, all code is written in Javascript, and you’ll need the iPhone emulator in order to see the results.
var servicesURL = 'http://example.com/services/json';
var domain = 'example.com';
var date = new Date();
var obj = {
method: service,
domain_name: domain,
domain_time_stamp: date.getTime(),
nonce: rnd(), /* just a random function that returns a random string */
sessid: sessionid
};
// create the hash using secure hash algorithm using 256bit encryption
obj.hash = HMAC_SHA256_MAC(apikey, obj.domain_time_stamp+";"+obj.domain_name+";"+
obj.nonce+";"+obj.method);
// this is your view name, be sure your authentication key allows access to views.get
obj.view_name = 'the_drupal_view';
// create the connection to our services module and send json data via POST
var xhr = Titanium.Network.createHTTPClient();
xhr.open("POST", servicesURL);
xhr.send({data: JSON.stringify(obj)});
// once our data has returned the onload function is used
xhr.onload = function(){
// perform your code here with the data coming back,
// data will be the object containing the response.
var data = JSON.parse(this.responseText);
// you can use Ti.API.info(JSON.stringify(data)) to output your response to the console
}
After I figured out how to put together the proper call out to the services from Javascript, I was able to format some data, here is my result:

Drupal connected iPhone application
Download the JS SHA265 library: js sha256 version 0.1
May 10th, 2010 |
Published in
Titanium, iPhone | 2 Comments
Today I started development on an iPhone app using Appcelerator Titanium. The app is for an adhoc distribution but may change to a full Apple app store release to the public.
The app is using Drupal is the base and the Services module to make the data connection. I’m using a modified JSON service module made available by CivicActions. CivicActions had a great drupalCon presentation on using Drupal to connect to a iPhone app using Titanium, which I am using as my inspiration to build this app.
Stay tuned for code examples on using the Services api and Drupal.
May 7th, 2010 |
Published in
Facebook, Social, iPhone
We’re looking to open up discussion on iPhone apps. We have some ideas on what apps we want to build, and we would love to hear your ideas too! Any feedback on ideas is greatly appreciated.
You can take part in our discussions on our facebook page.
May 3rd, 2010 |
Published in
Clients, Hangar 18 Creative, Karen Munnis, Magnum Creative Inc., Vacuum Design
The projects page has been updated with new portfolio pieces including:
Mountain Trek
Global Mortgage
BCAA Drupal multi-site
Karen Munnis
All of these websites are Drupal installations, custom themes, and custom programming!
April 26th, 2010 |
Published in
Services
Soniccode services page has been published. Following the new services announcement, more information is available by following the services link!
April 23rd, 2010 |
Published in
Services
We are please to announce our new weekly and monthly service plans, you can contact us for more details by calling 778.737.6260 or emailing info@soniccode.com with the subject Prepaid Services.
Our prepaid weekly and monthly services will help to lower your development costs and provide you with a expertise you may not have had before.
Soniccode can help you with:
- PHP, HTML, CSS, jQuery, Flash and Flex
- Drupal, WordPress, third party applications and Frameworks
- iPhone Applications
- Custom database applications
Soniccode Weekly and Monthly Service Promotion – PDF Download
May 28th, 2009 |
Published in
Clients, Livingblueprint
Soniccode E-Solutions created a new WordPress theme for Work in Progress, a Vancouver based company that specializing in career transition.
Working closely with Livingblueprint, the marketing strategists behind the new corporate brand, we were able to meet a tight deadline to get this website launched.
April 9th, 2009 |
Published in
iPhone
Enabling a website for the Apple iPhone
To help maximize the consumer audience you can enable your website to be viewable by the largest growing mobile device, the Apple iPhone. Strict XHTML code along with cleverly placed elements will allow your site to be viewed with ease by iPhone and iPod Touch browsers.
Another method is to program your website directly for the iPhone/iPod browser by targeting it through code, and forwarding the address to your custom build website. If you try to view http://soniccode.com with your iPhone or iPod Touch, you will get forwarded to http://iphone.soniccode.com which is our iPhone capatible website.
Soniccode E-Solutions has services available to provide your website content deliverable to the iPhone/iPod browser, contact us at iphone-inquiry@soniccode.com