Hello all.

First and foremost, Drupal iOS SDK is awesome and quite a piece of work. With it, I've been able to build an app that enables users to quickly access data they've inputted on my Drupal site from their iOS device (Android coming soon). However, I have developed coder's block and am stuck. Please see below.

Currently, my iOS app allows users to only look at information they've inputted on the Drupal site. I would like to give them the ability to edit the information from the device itself. However, this is challenging because the data on the site is entered using a webform and the view that provides the data for the app is built using webform submitted data. There is no node, that I know of, that contains the data for the view. As such, Drupal iOS SDK's nodeUpdate method isn't helpful. Furthermore, there is no viewUpdate and/or webform_submissionUpdate method, again that I know of, that I can use to enable editing from within the app. Do any of you know of any method or strategy that I could use to enable editing of the Drupal webform submitted data table from within an iOS app?

Thank you in advance for your help and have a great day!!!

Comments

goofus’s picture

Hello.
I going to summarize your issue, just to explain my question :)

You have a client app and a server app. The client app is your IOS mobile app. The server app is your Drupal installation.

You need to converse between client and server. However, your current message processing doesn't match. The client only speaks "nodes", The server only speaks "web form".

So which app can you change?

Does the server (Drupal) require use of "web form" instead of "node"? . In other words, is the "web form" processing some legacy function that you can not change?

The same type of question applies to the client app.

You've referenced a "Drupal iOS SDK", which looks like a library (set of specialized methods). However, you can certainly communicate over http with Apple's XCode. So the question is, are you are restricted exclusively use the methods in the "Drupal iOS SDK"? Or, can you use an additional library (Apple Xcode or any other) to communicate via http?

To summarize, which side (client or server) can you change?

Good Luck :)

doctorDrupal’s picture

That's a stellar and thoughtful response!!!

Essentially, when it comes to connecting my iOS app to my Drupal installation, I cannot find an API as robust as Drupal iOS SDK anywhere else (e.g. Titanium). Put another way, I understand the inner workings of the Drupal iOS SDK better than I understand that of another API. As such, the implication is that I really don't want to change my client side.

Regarding the potential to change the server side, I cannot find a module that accomplishes what I need better than the Webform module (coupled with the Views and Services modules). Together, these three modules provide a server side solution that really works for what I'm trying to do. Put another way, these modules work very well, are very easy to understand, and get the job done. As such, the implication is that I really don't want to change my server side.

Now, all that being said, I have considered leaving everything as is in order to retain the current functionality. However, I am more than interested in learning about other ways to connect my iOS app with my Drupal installation to accomplish specific tasks. Please see below:

1. Update the Drupal iOS SDK to allow editing of the webform submitted data table (either I would have to do it or the guy who wrote the Drupal iOS SDK would have to do it). This route would require #2 below because Drupal iOS SDK uses the Services module.

2. Update the Drupal Services module to enable editing webform submissions, specifically the webform submitted data table (either I would have to do it or the module's maintainer would have to do it).

3. Connect my iOS app to my Drupal installation using another API, SDK, or library (e.g. XCode) that will allow my app to connect to my Drupal database to change specific values within specific tables. I will research this and see what I can find. If you have any resources you can send my way, I would very much appreciate it.

So, as you can see, I'm happy with my current implementation for current functionality. But, I am definitely not averse to taking another route to add functionality. I sincerely and truly thank you for your kind, thoughtful, and thought-provoking response. Your response was exactly what I needed to start overcoming my coder's block.

goofus’s picture

Hello,
You are welcome. Glad to have helped :)

Your server app (Drupal) is constructed with open source non-proprietary technology. Your client app is constructed with closed source proprietary technology (I.E. Apple IOS).

By definition, Drupal (an open source stack) cannot process Apple's proprietary formats (I.E. read or write XCODE encoded data on anything other than an Apple licensed stack).

However, you can use non-proprietary technology to communicate between client and server. 2 examples are 1) XML 2) JSON. Both XML and JSON are text based message structures. You typically (but not limited to) use HTTP to transport the messages.

On the server (Drupal) side, HTTP communications is performed by the core system. None of the contributed modules you listed are required.

Same thing on the client side. The Druapl IOS SDK is not required to process HTTP communications.

A web browser running javascript can also process HTTP communications. Javascript is a open standard. Javascript is not a proprietary/closed source technology. Thus, to me, I just use a mobile web browser/javascript client. I don't want to use technology that Google. Apple or Microsoft owns and controls. Those companies decide what application you get to implement. Not something I want to invest my time in. Anyway, that's my approach.

You should also check out Apache's Cordova/Phonegap project. It's a cross-platform solution.

If you feel your base issue is solved. [lease make sure to edit your original post's subject line. Add "[SOLVED]" to either the beginning or the end. That way other folks can find the solution :)

Good Luck:)

doctorDrupal’s picture

Thank you for your help.

Unfortunately, the javascript/mobile web browser solution won't work. As much as I dislike having another technology owning and controlling my solutions, I do like the fluidity and smoothness when things do work. While this does make it difficult to expand beyond the scopes that they have defined, I find that it provides what I and my potential customers need. As such, I won't be abandoning Drupal iOS SDK anytime soon. I suspect that a solution will come soon (even if I have to build it myself).

So, all that being said, I can't close this yet because I still need guidance on how others have worked around (or through) this roadblock.

Thanks again for all your help and have a great day!!!

goofus’s picture

Hello,
Please try to avoid making harsh assertions

the javascript/mobile web browser solution won't work

.

You mean you don't prefer to use a mobile browser solution :) That's a lot different than simply dismissing a working solution :) There is a difference between what "works" and "what your preference is" :)

Good Luck :)

doctorDrupal’s picture

You are absolutely correct--my apologies and, again, thanks for your input.

paewrblue’s picture

Hi, DoctorDrupal

I've been working on my IOS project for about a week.
By the way that has pretty much the same scope as your.
So, i'm asking for your help, I've configured everything on xcode. (I'm running my Drupal Webserver on the Localhost).
I coudn't find a way to login to my Drupal-Server from running the IOS emulator.
I did the tracking by using the NSLog to see connect of methods/paths.
Somehow, I've found that in the DIOSUser.m

if ([[DIOSSession sharedSession] signRequests]) {
[[DIOSSession sharedSession] sendSignedRequestWithPath:path
method:@"POST"
params:params
success:success
failure:failure];
NSLog(@"inside Post method");
}
else {
[[DIOSSession sharedSession] postPath:path
parameters:params
success:success
failure:failure];
NSLog(@"outside post method");
}

my NSLog(@"inside Post method"); did not appear, So I moved on to dig deeper to the shareSession in the DIOSSession

+ (DIOSSession *)sharedSession {
dispatch_once(&once, ^ {
NSLog(@"sharedSession Yo!!!");

sharedSession = [[self alloc] initWithBaseURL:[NSURL URLWithString:kDiosBaseUrl]];

[sharedSession setParameterEncoding:AFJSONParameterEncoding];

});
return sharedSession;
}

Now, NSLog(@"sharedSession Yo!!!"); is appeared. I did check the kDiosBaseUrl which is http://localhost/drupal
and my kDiosBaseUrl is rest.

I know that it is inappropriate to ask another developer for a zip of their projects.
But, can you at least sent me a zip of your project to my email: viper1344@gmail.com
I want to use it as a reference. I desperately need help with this issue and there aren't any tutorials about IOS SDK Drupal,
that can get me to achieve my goals.

I Would be very appreciated if you could help me out with this.
Thank you
Pae