FatFractal customer forums



Author Topic: Oops  (Read 1826 times)

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Oops
« on: March 30, 2014, 10:09:15 AM »
I made a couple of unstable releases of the iOS SDK in the past 24 hours ...

If you've downloaded and are using FF_IOS_SDK_R1.3.3_R2712 or FF_IOS_SDK_R1.3.3_R2713 please download and use the latest SDK FF_IOS_SDK_R1.3.3_R2714 instead - available either here http://system.fatfractal.com/console/ff/ext/Releases/Latest/FF_IOS_SDK or here https://system.fatfractal.com/repo/artifact/Releases/R1.3.3/FF_IOS_SDK_R1.3.3_R2714.zip

Sorry for any inconvenience caused!


NOTE: Please always check here for latest releases : http://fatfractal.com/downloads
« Last Edit: September 26, 2014, 06:22:29 AM by gkc »

jonnycools

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Oops
« Reply #1 on: March 31, 2014, 04:37:34 PM »
Not sure if this is related to this or not but I'm having an issue getting the result from a extension using read requests.

I create it. Prepare it using prepareGetFromExtension, then execute is async without options.

I should mention that i'm only returning a string from the server.

Now when i retrieve i from the response.obj it prints out in the console. I see the text of the response and its there but response.obj returns null.

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Oops
« Reply #2 on: March 31, 2014, 05:22:41 PM »
No it's not related

Can you share your extension code please?

jonnycools

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Oops
« Reply #3 on: April 02, 2014, 12:26:53 PM »
Sorry totally spaced on this.

I went back to the trusty postObj: toExtension.

I wrote a test extension for this.

iOS

Code: [Select]

FFReadRequest * request = [[FatFractal main] newReadRequest];
   
    [request prepareGetFromExtension:@"extension"];
   
    [request executeAsyncWithBlock:^(FFReadResponse *response) {
       
        NSLog(@"%@", response.obj);
       
    }];


JS

Code: [Select]

var response = ff.response();

response.responseCode = 200;

response.statusMessage = "Request successful";

response.result = "test";

response.mimeType = "application/json";

return;


Log iOS

Code: [Select]

2014-04-02 12:24:20.430 I Live VIP Venue[13193:60b] objectsFromJsonResponse {
    result = test;
    statusMessage = "Request successful";
}
forRequestUri https://*****
httpResponse <NSHTTPURLResponse: 0x17585270> { URL: https://****** } { status code: 200, headers {
    Connection = "keep-alive";
    "Content-Length" = 54;
    "Content-Type" = "application/json";
    Date = "Wed, 02 Apr 2014 16:24:21 GMT";
    Pragma = "no-cache";
    Server = "nginx/1.2.5";
    "X-Powered-By" = "FatFractal 0.1";
} }
loadFromCacheOnly 0
doAutoLoadRefs 1
doAutoLoadBlobs 0
2014-04-02 12:24:20.431 I Live VIP Venue[13193:60b] (null)


gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Oops
« Reply #4 on: April 02, 2014, 05:06:47 PM »
It is expected that "result" is set to either a valid object (or array of objects)

So you have two options; either
(1) in your server extension, have
Code: [Select]
response.result = {s:"test"};
or
(2) in your iOS code, you can get a hold of the "rawResponseData" and do with it what you will, eg
Code: [Select]
NSError *jsonResponseError;
id unmarshalled = [NSJSONSerialization JSONObjectWithData:response.rawResponseData options:NSJSONReadingAllowFragments error:&jsonResponseError];

Hope that helps

Cheers

- Gary

 

Copyright © FatFractal customer forums