10. OBJC: GET NODETITLE
NSMutableDictionary *nodeData =
[NSMutableDictionary new];
[nodeData setObject:@"12" forKey:@"nid"];
[DIOSNode nodeGet:nodeData success: ^(AFHTTPRequestOperation
*operation, id responseObject) {
//Get the title
_titleTextField.text =
[responseObject objectForKey:@"title"];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//We failed to get the node
}];
11. NODE BODY JSON
"body": {
"und": [
{
"value":“Hello world.",
"summary": "",
"format": "filtered_html",
"safe_value": "<p>Hello world.</p>n",
"safe_summary": ""
}
]
},
How do I get that???
12. OBJC: GET CUSTOM FIELD
VALUE
//Needs the "field_" prefix
NSDictionary *languageDict =
[responseObject objectForKey:@“field_address"];
NSArray *bodyValues =
[languageDict objectForKey:@“und”];
NSDictionary *descDict =
[bodyValues objectAtIndex:0];
_addressTextField.text =
[descDict objectForKey:@"value"];
13. GITHUB EXAMPLES
• Human Alert w/ Drupal iOS SDK demo
• OpenDatasets iOS
• Demonstrates the use of Drupal 7 iOS SDK
14. D7VS D8?
• Stay with D7 for now
• D8 still in beta
• No upgrade path between betas
• Modules (Rules, Push Notifications,…) not D8
ready
15. TIPS N’TRICKS
• Modules to use
• Geofield
• Rules
• ServiceTools (Services versioning!)
• Push Notifications
• Services Entity API
• Content API
• ServicesViews (?)
• Use entities instead of nodes (ECK module)
• MongoDB module
• Node.js module (?!)
16. VS
Services RESTWS RESTful
SDK available Querying filters Querying filters
Select specific fields
(Content API)
Return specific fields List all entities
Versioning (ServiceTools)
Resource documentation
(json)
Versioning
Many Services specific
modules
Autocomplete call
Bloated JSON Requires plugin coding
“field_” prefix
Attention: Non conclusive list!
17. WHY NOT DRUPAL
• Performance overhead (PHP, mySQL, Drupal
Framework)
• Maturity of iOS SDK (vs popular backend SDKs
[e.g. Parse])
• Learning curve (Drupal API for custom modules)
• Invest on an expiring version (D7)