Giter VIP home page Giter VIP logo

loopback-sdk-ios's Introduction

LoopBack iOS SDK

Status

As a former StrongLoop Labs project, this SDK may lack usability, completeness, documentation, and robustness, and may be outdated. StrongLoop/IBM is no longer maintaining this project actively, however we do provide support for our paying customers through usual IBM support channels.

Our recommendatios is to use IBM Mobile First platform or Swagger codegen instead of this SDK.

We are looking for volunteers from our community to pick up the maintenance of this project, see #136

Description

The LoopBack iOS SDK obviates the need for using the clunky NSURLRequest and similar interfaces to interact with a LoopBack-based backend, albeit RESTful. Instead, interact with your Models and Data Sources in a comfortable, first-class, native manner.

This section describes v1.1 version of the LoopBack iOS SDK. The following API changes were made:

  • LBModelPrototype was renamed to LBModelRepository
  • findWithId was renamed to findById

See also the LoopBack iOS SDK documentation.

loopback-sdk-ios's People

Contributors

ageneau avatar bajtos avatar crandmck avatar dhmlau avatar hideya avatar kexoth avatar raymondfeng avatar rmg avatar schoonology avatar siddhipai avatar sphess avatar superkhau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loopback-sdk-ios's Issues

Apple swift enablement

I tried to use the SDK in Apple's new swift programming language by bridging to OC. I couldn't call "LBRESTAdapter adapterWithURL". Since the method isn't in "LBRESTAdapter" maybe just adding the .h files of "SLRESTAdapter" would do the trick. I'm just not sure how to do that.

Did anyone try it with swift so far?

Issue while uploading LBFile.h

- (void)uploadWithSuccess:(LBFileUploadSuccessBlock)success failure:(SLFailureBlock)failure; 

This Function uses /../ModelName/prototype instead of the ../ModelName/{containerName} for uploading the file. I'm not sure if this is a bug, or I am just stupid.

Upsert fails when invoked right after create

The following code that tries to update a model right after its creation fails with the error below:

    Widget *widget = (Widget*)[self.repository modelWithDictionary:nil];
    widget.name = @"Foobar";
    widget.bars = @123;

    [widget saveWithSuccess:^{
        widget.name = @"Barfoo";
        [widget saveWithSuccess:^() {
            ....
error: -[LBPersistedModelSubclassingTests testUpdate] : failed - 
Test failed: Error Domain=AFNetworkingErrorDomain Code=-1011 
"Expected status code in (200-299), got 404" 
UserInfo={NSLocalizedRecoverySuggestion={"error":{"name":"Error","status":404,
"message":"could not find a model with id :id",
"statusCode":404,"code":"MODEL_NOT_FOUND",
"stack":"Error: could not find a model with id :id
...

The server side is seeing a request PUT /widgets/:id? which is failing to replace :id with the actual value.

This is a major issue. Need to be fixed soon. BTW, the unit test was not successful to capture this issue since it has findById between the first and the 2nd saves. This test needs to be updated too.

Logout user is not working - GET instead of POST used

The logout method in the LB iOS FW uses GET instead of POST. Hence the logout is not working (404).

It should be - LBUser.m:

    - (SLRESTContract*)contract
    {
        SLRESTContract* contract = [super contract];

        [contract addItem:[SLRESTContractItem itemWithPattern:[NSString stringWithFormat:@"/%@/logout", self.className] verb:@"POST"]
                forMethod:[NSString stringWithFormat:@"%@.logout", self.className]];

        return contract;
    }

Casting child object from [filter:include] request using LBPersistedModels

I must be missing something wrong because i can not directly translate child objects that are "filter[include]" to their respective model class types. I created a parser method to handle this.
Any recommendations to do it easier or correctly?

I request the child objects through a parent model like this

 [[[self adapter] contract] addItem:[SLRESTContractItem itemWithPattern:@"/Notes" verb:@"GET"] forMethod:@"Notes.filterOne"];
    [self.notesModelRepository
    invokeStaticMethod:@"filterOne"
    parameters: @{ @"filter[include]":
    @[ @"TAGS", @{@"profile" : @[@"ACCOUNT", @"TYPE", @"MEDIA", @"STATUS" ]}],
    @"filter[where]": @{ @"id" : iid } }
         success:staticMethodSuccessBlock    failure:staticMethodErrorBlock];

My Child Model Class is here

@interface MediaModel : LBPersistedModel
@property (nonatomic, copy) NSString *URL1;         //  (string, optional),
@property (nonatomic, copy) NSDate *URL2;           //  (string, optional),
@property (nonatomic, copy) NSDate *DATA;           //  (any, optional),
@property (nonatomic, copy) NSString *created;            //  (string, optional),
@property (nonatomic, copy) NSString *updated;             //  (string, optional),
@property (nonatomic, copy) NSString *REFERENCE;        //  (any, optional),
@property (nonatomic, copy) NSString *mediaId;          //  (objectid, optional)

//  =====================   RELATIONS  ========================
@property (weak) NSObject *TYPE;
- (MediaModel*) transformMediaModel:(LBPersistedModel *)model;
- (MediaModel*) transformMediaObject:(NSObject *)model;
- (NSMutableArray *) processArrayMediaModels:(NSArray*)model;

@end

And the model looks like this

-(MediaModel*) transformMediaObject:(NSObject *)model{

    [self setValue:[model valueForKeyPath:@"created"] forKeyPath:@"created"];
    [self setValue:[model valueForKeyPath:@"updated"] forKeyPath:@"updated"];
    [self setValue:[model valueForKeyPath:@"id"] forKeyPath:@"mediaId"];
    [self setValue:[model valueForKeyPath:@"TYPE"] forKeyPath:@"TYPE"];

    [self setValue:[model valueForKeyPath:@"URL1"] forKeyPath:@"URL1"];
    [self setValue:[model valueForKeyPath:@"URL2"] forKeyPath:@"URL2"];
    [self setValue:[model valueForKeyPath:@"DATA"] forKeyPath:@"DATA"];
    [self setValue:[model valueForKeyPath:@"REFERENCE"] forKeyPath:@"REFERENCE"];

    return self;
}

- (NSMutableArray *) processArrayMediaModels:(NSArray*)model{
    NSMutableArray *jMEDIA = [[NSMutableArray alloc] init];

    for(NSDictionary *tMEDIA in [model objectAtIndex:0]){
        NSLog(@"MEDIA ITEM: %@", tMEDIA);
        if(tMEDIA == (id)[NSNull null]){
        }else{
            LBRESTAdapter *adapter = ((AppDelegate *)[[UIApplication sharedApplication] delegate]).adapter;
            MediaModelRepository *lbr = (MediaModelRepository*)[adapter repositoryWithModelName:@"Media" persisted:YES ];
            LBPersistedModel *xt  = (LBPersistedModel *)[lbr modelWithDictionary:tMEDIA];
            [jMEDIA addObject:[self transformMediaObject:[xt toDictionary]]];
        }
    }

    return jMEDIA;
}

Relationships handling

What would be the best way to handle relationships with SDK? As for now I have only one idea — invokeStaticMethod. Any other suggestions? References to working code would be helpful. Thanks.

Support for Generics

Generics has been introduced in Objective-C since Xcode 7 but the SDK is not updated to take advantage of it. Nullability annotation and __kindof declaration are also introduced. Those would better be applied to the SDK to improve its usability.

LB 2.0 PersistedModel support

LoopBack 2.0 introduced "New object PersistedModel" (Release Notes) but iOS SDK has not yet updated to follow the new convention. Although it breaks backward code compatibility, thought it would better be done.

Issue with SLStreamParam while uploading UIImage

Hey @ all,

I create an LBFile as following:

LBFileRepository *receiptFiles = [LBFileRepository repositoryWithClassName:@"Receipt"];
[receiptFiles setAdapter:self.loopbackAdapter];
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"2015-06-01-aldi" ofType:@"png"];
LBFile *file = [receiptFiles createFileWithName:@"2015-06-01-aldi.png" localPath:imagePath container:@"demo-receipts-us"];

This works like charm.

When I try to upload the file I get an error in SLAFHTTPClient.m:

error: -[APIManagerTests testReceiptUpload] : failed: caught "NSInvalidArgumentException", "Invalid type in JSON write (SLStreamParam)"
(
    0   CoreFoundation                      0x00000001065eac65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000106283bb7 objc_exception_throw + 45
    2   CoreFoundation                      0x00000001065eab9d +[NSException raise:format:] + 205
    3   Foundation                          0x00000001042a1fd0 _writeJSONValue + 689
    4   Foundation                          0x00000001042a646f ___writeJSONObject_block_invoke + 220
    5   CoreFoundation                      0x000000010652a656 __65-[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:]_block_invoke + 102
    6   CoreFoundation                      0x000000010652a55c -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 204
    7   Foundation                          0x00000001042a6080 _writeJSONObject + 376
    8   Foundation                          0x00000001042a1ea6 _writeJSONValue + 391
    9   Foundation                          0x00000001042a1cea -[_NSJSONWriter dataWithRootObject:options:error:] + 137
    10  Foundation                          0x00000001042a476b +[NSJSONSerialization dataWithJSONObject:options:error:] + 345
    11  {APPNAME}                             0x00000001027a90de -[SLAFHTTPClient requestWithMethod:path:parameters:] + 1950
    12  {APPNAME}                             0x00000001027c5fe3 -[SLRESTAdapter requestWithPath:verb:parameters:multipart:outputStream:success:failure:] + 867
    13  {APPNAME}                             0x00000001027c55ed -[SLRESTAdapter invokeStaticMethod:parameters:outputStream:success:failure:] + 893
    14  {APPNAME}                             0x00000001027c5214 -[SLRESTAdapter invokeStaticMethod:parameters:success:failure:] + 196
    15  {APPNAME}                             0x00000001027c49ea -[SLRepository invokeStaticMethod:parameters:success:failure:] + 298
    16  {APPNAME}                             0x000000010279d9d2 -[LBFileRepository uploadWithName:container:inputStream:contentType:length:success:failure:] + 658
    17  {APPNAME}                             0x000000010279dd24 -[LBFileRepository uploadWithName:container:data:contentType:success:failure:] + 436
    18  {APPNAME}                             0x000000010276616c -[APIManager uploadReceiptWithFilename:image:extractions:] + 476
    19  {APPNAME}Tests                        0x0000000111d069f5 -[APIManagerTests testReceiptUpload] + 277
    20  CoreFoundation                      0x00000001064e0dec __invoking___ + 140
    21  CoreFoundation                      0x00000001064e0c42 -[NSInvocation invoke] + 290
    22  XCTest                              0x0000000111d1317a -[XCTestCase invokeTest] + 253
    23  XCTest                              0x0000000111d13379 -[XCTestCase performTest:] + 150
    24  XCTest                              0x0000000111d1cc35 -[XCTest run] + 260
    25  XCTest                              0x0000000111d1208b -[XCTestSuite performTest:] + 379
    26  XCTest                              0x0000000111d1cc35 -[XCTest run] + 260
    27  XCTest                              0x0000000111d1208b -[XCTestSuite performTest:] + 379
    28  XCTest                              0x0000000111d1cc35 -[XCTest run] + 260
    29  XCTest                              0x0000000111d1208b -[XCTestSuite performTest:] + 379
    30  XCTest                              0x0000000111d1cc35 -[XCTest run] + 260
    31  XCTest                              0x0000000111d0f129 __25-[XCTestDriver _runSuite]_block_invoke + 56
    32  XCTest                              0x0000000111d19edd -[XCTestObservationCenter _observeTestExecutionForBlock:] + 162
    33  XCTest                              0x0000000111d0f060 -[XCTestDriver _runSuite] + 269
    34  XCTest                              0x0000000111d0fa8d -[XCTestDriver _checkForTestManager] + 234
    35  XCTest                              0x0000000111d1fb20 +[XCTestProbe runTests:] + 182
    36  Foundation                          0x00000001041ba1e5 __NSFireDelayedPerform + 387
    37  CoreFoundation                      0x0000000106552174 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    38  CoreFoundation                      0x0000000106551d35 __CFRunLoopDoTimer + 1045
    39  CoreFoundation                      0x0000000106513d3d __CFRunLoopRun + 1901
    40  CoreFoundation                      0x0000000106513366 CFRunLoopRunSpecific + 470
    41  GraphicsServices                    0x0000000107b4aa3e GSEventRunModal + 161
    42  UIKit                               0x0000000104bda8c0 UIApplicationMain + 1282
    43  {APPNAME}                             0x000000010276050f main + 111
    44  libdyld.dylib                       0x0000000106b2c145 start + 1
)

It seems like in line 488, the following code throws the bug, because inside the NSDictionary there is an object of SLStreamParam which is not amused to be wrapped into an JSONObject. 😉

[request setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error]];

I tried to upload the file with the default method:

- (void)uploadWithSuccess:(LBFileUploadSuccessBlock)success
                  failure:(SLFailureBlock)failure;

and with the two new methods from @hideya from #47 :

- (void)uploadWithName:(NSString *)name container:(NSString *)container data:(NSData *)data contentType:(NSString *)contentType success:... failure:...
- (void)uploadWithName:(NSString *)name container:(NSString *)container inputStream:(NSInputStream *)inputStream contentType:(NSString *)contentType length:(NSInteger)length success:... failure:...

Best Lennart

Subclass LBPersistedModelRepository in Swift

I'm having problems subclassing LBPersistedModelRepository in Swift.

class ProductRepository: LBPersistedModelRepository     {
    override init!(className name: String!) {
        super.init(className: "Products")
    }
    override init() {
        super.init(className: "Products")
    }
}

When I run my app now I get the following exception:

'NSInternalInconsistencyException', reason: '+[LBModelRepository repository] must be overridden appropriately in a subclass'

The problem is that there's no proper way to override + (instancetype)repository in Swift. Maybe it's a good idea to change the way it's currently implemented to enable people to use the SDK with Swift?

Is there any known workaround for this issue?

@hideya It would be nice if you could explain why you added commit 9f8aecd

Automatic Creation of LBModel Objects for Included Relations

How can I achieve that related Objects that are included (via include filter) are automatically parsed into the correct LBModel?

Example:

    <FSDish {
        name = Pizza;
        orders =     (
                    {
                unitPrice = "2.99";
                userId = 54ca8404f0d971928b50b9c8;
            }
        );
    }>

The orders array should contain FSOrder objects, how to achieve that without manually parsing?
I assume creating an SLContract? Any Examples?

Can not subclass LBUserRepository in swift

class CustomerRepository:LBUserRepository {
    override class func repository() -> CustomerRepository {
        let repo = CustomerRepository(className: "Customer")
        return repo
    }
}

Tried to subclass LBUserRepository but I keep getting this error: "Cannot override 'repository' which has been marked unavailable"
What am I missing?

Exception since updating to latest SDK version

As mentioned in an other issue the logout still uses GET instead of POST in the version that is available through the official website, so I decided to update the SDK.

I used a Podfile to get the latest version from GitHub:
pod 'LoopBack', :git => 'https://github.com/strongloop/loopback-sdk-ios.git'

Now that I got the latest version I'm facing an other problem While running the following code I get the following exception:

2015-12-09 23:25:02.820 Loopback-Swift-Example[70252:3394580] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[LBModel setEmail:]: unrecognized selector sent to instance 0x7fdeeac41f30'

Here's the code causing the problem (important: before the update everything worked like a charm):

let adapter = appDelegate.adapter as LBRESTAdapter!
let repo = adapter.repositoryWithClass(ClientRepository) as! ClientRepository
var user = repo.createUserWithEmail(EmailTextField.text!, password: PasswordTextField.text!)

Examples showing how to query for object relations from loopback SDK

I am trying to query a loopback server for relations between models, I have a "Section" Model and an "item" model, and a has me nay relation between them, so I can query for all items in a section with /sections/:id/items from a rest client.

How can I do the same query from loopback iOS client? any documentation or code examples?

LBFile/LBContainer API improvements?

LBFile looks left in a halfway-done status, and I'm wondering any effort should be made to update it
so that it looks closer to the Android one. Currently, the APIs for iOS's and Android's SDKs LB file support look very different (and Android one seems more matured). Considering easiness of multi-device support by developers, I think the both are better be aligned.

LBFile doesn't use LBContainer at all, whereas LBContainer class exists in the SDK. LBContainer doesn't have any methods for LBFile operation neither.

Furthermore, LBFile's API philosophy looks different from Android one. LBFile seems designed more like a representation of a local file which can be stored onto the server. Android's File looks more like a representation of a remote file that can be downloaded to local.

If we make iOS SDK's file API close to Android one, it will break compatibility. As far as I can tell, the following breaking changes will be needed:

  • Use of LBContainer instead of NSString in LBFile when specifying a container.
  • Removal of [LBFile -uploadWithSuccess:failure:] method.
  • Removal of LBFile.localPath property.

Even with those backward incompatible changes, I think it is beneficial to make the above mentioned updates to LBFile/LBContainer.

Does anyone have any thoughts on this?

Examples showing how to query for object relations from loopback SDK

Hi,

I am trying to query a loopback server for relations between models, I have a "Users" Model and an "Cars" model, and a has me nay relation between them, so I can query for all items in a section with /users/:id/cars from a rest client.

any documentation or code examples?

LBFile uploadWithName should return HTTP Response

I feel like it would be helpful if uploadWithName would pass the actual HTTP Response into the success callback or even an LBFile object.

https://github.com/strongloop/loopback-sdk-ios/blob/master/LoopBack/LBFile.m#L188

For example I'm converting the filename on the server side to a random hash value, and I need the HTTP response to let the client side know what the new filename is.

I suggest the following:
In L188 in LBFile.m convert the id value to an actual LBFile object and pass it into success (Sadly we can't use modelWithDictionary, as the dictionary looks a little different as the one from the getFileWithName for example). I'll try to workout the details and open a PR soon, for now I'd appreciate what you guys think about this especially on how to convert the value to a LBFile.

sdk should expose AFNetworking

for now if I need custom request, I need add an external AFNetworking lib, but I think I should have made use of bundled AFNetworking lib

Can't clone the repo

git clone https://github.com/strongloop/loopback-sdk-ios.git --recursive
throws the error message:
No submodule mapping found in .gitmodules for path 'SLRemoting'

AFNetworking EXC_BAD_ACCESS while using downloadAsDataWithName[...] in LBFile.m (iOS Device only)

Hey @ all,

I ran into the following issue:

AFNetworking (15): EXC_BAD_ACCESS (code=1, address=0x6647000)

in Line 797 in SLAFURLConnectionOperation.m.

I used this methof of LBFile.h:

- (void)downloadAsDataWithName:(NSString *)name
                     container:(NSString *)container
                       success:(LBFileDownloadAsDataSuccessBlock)success
                       failure:(SLFailureBlock)failure;

In the simulator it works like charm. On real iOS devices it crashes. 🔥

Best Lennart


EDIT (2015-08-13)

I use this method to download a image from amazon s3.

LBInstallation _id not set

After updating to the latest version of sdk, my code broke when working with LBInstallation. After digging into it found that it should be related to #40
I have 2 issues:

  1. after registerDeviceWithAdapter in success callback, mode._id got to null

  2. when re-registring (updating an LBInstallation) loopback tries to create existing model here
    https://github.com/strongloop/loopback-sdk-ios/blob/master/LoopBack/LBPersistedModel.m#L39
    again since self._id is null

My code was working with old version of SDK, found no documentation about this... or how to write against the new changes.

Obj-C property mapping to use primitive types in LBPersistedModel?

In the current implementation, Number and Boolean types are both mapped to NSNumber. It would have been much programmer friendly if those can be accessed via primitive types, namely long and BOOL respectively.

For example, the following is a code example with the current mapping:

NSNumber *n = model.someNumber;
NSNumber *b = model.someBoolean;
model.someNumber = @123;
model.someBoolean = @YES;

With proposed mapping, an equivalent code would look like the following:

long n = model.someNumber;
BOOL b = model.someBoolean;
model.someNumber = 123;
model.someBoolean = YES;

How about making this change? (although it is a backward compatibility breaking change...)

BTW, I came across this issue while working on codegen for iOS SDK. Generated code would look much better and easier to use with primitive type mappings.

LB Container issue, Cannot call RestAPI methods

Hi, We have implemented loopback and created a container. However we have named it as: imagecontainer in server. However when I am trying to call container related methods, I am getting error information. In this error I still see loopback api still pointing to "container" and not "imagecontainer". Not sure if this is hardcoded in SDK? Can you pls. check and let us know the issue.

Below is the error from .getContainerWithName, this method works when we rename the model-> container (instead of imagecontainer)

Error Domain=AFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), got 404" UserInfo={NSLocalizedRecoverySuggestion={"error":{"name":"Error","status":404,"message":"There is no method to handle GET /containers/:container/files/container1?name=container1","statusCode":404,"stack":"Error: There is no method to handle GET /containers/:container/files/container1?name=container1\n at restUrlNotFound (/usr/share/strongloop/Originale/node_modules/loopback/node_modules/strong-remoting/lib/rest-adapter.js:337:17)\n at Layer.handle as handle_request\n at trim_prefix (/usr/share/strongloop/Originale/node_modules/loopback/node_modules/express/lib/router/index.js:312:13)\n at /usr/share/strongloop/Originale/node_modules/loopback/node_modules/express/lib/router/index.js:280:7\n at Function.process_params (/usr/share/strongloop/Originale/node_modules/loopback/node_modules/express/lib/router/index.js:330:12)\n at next (/usr/share/strongloop/Originale/node_modules/loopback/node_modules/express/lib/router/index.js:271:10)\n at jsonParser (/usr/share/strongloop/Originale/node_modules/loopback/node_modules/body-parser/lib/types/json.js:100:40)\n at Layer.handle as handle_request\n at trim_prefix (/usr/share/strongloop/Originale/node_modules/loopback/node_modules/express/lib/router/index.js:312:13)\n at /usr/share/strongloop/Originale/node_modules/loopback/node_modules/express/lib/router/index.js:280:7"}}, NSErrorFailingURLKey=htt8081/api/containers/:container/files/container1?name=container1, AFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest: 0x7ffdf040c7f0> { URL: htt8081/api/containers/:container/files/container1?name=container1 }, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x7ffdf0587f00> { URL: http8081/api/containers/:container/files/container1?name=container1 } { status code: 404, headers {
"Access-Control-Allow-Credentials" = true;
Connection = "keep-alive";
"Content-Encoding" = gzip;
"Content-Type" = "application/json; charset=utf-8";
Date = "Wed, 16 Dec 2015 21:40:15 GMT";
Etag = "W/"5f9-FV5GYUPBR8ppq0KW8eZKIA"";
"Transfer-Encoding" = Identity;
Vary = "Origin, Accept-Encoding";
"X-Powered-By" = Express;
} }, NSLocalizedDescription=Expected status code in (200-299), got 404}

Import of MobileCoreServices.h missing @ LBFile.m

Hey there, if you use the loopback-sdk-ios with cocoa pods, there are three issues at LBFile.m because the following import is missing.

#import <MobileCoreServices/MobileCoreServices.h>

In the Loopback.xcodeproj this import is inside the LoopBack-Prefix.pch-file, but this one is ignored by cocoa pods.

Best Lennart

Use a stored user access token?

Hi guys,

Here is my question: is there any way to use a stored user access token when I launch my iOS app, without having to log in again?

Since the user token is stored after a successful login in the LBAccessToken object and then used during the session, is there any way to inject a stored user access token from a previous session and still be able to use it?

Thanks!

Proposal to add "accepts" and "returns" to SLRESTContract

As pointed out in #83 (comment), "the response ("returns" argument) is always passed as a JSON object and it's up to the API caller to extract individual arguments from the response, together with applying any type conversions as necessary."

One approach to hide that conversion process from SDK users is to add "accepts" and "returns" to SLRESTContract and perform the conversion in SLObject automatically. This should simplify the usage.

Add Swift-based unit tests

There was a case where a PR caused a Swift compatibility issue #87 although this didn't cause any issue with Objective-C. In order to avoid such modifications, Swift-based unit test would better be added.

Is this project still alive?

No commit in nearly 4 months and many features added to loopback? When iOS client will support these new features?

Suggestion to get rid of Settings.plist

Today I configured Notification with LB iOS SDK.

I noticed, that the framework has hardcoded to reference: Settings.plist for e.g. AppId and AppVersion.

Since we have the version already in the Info.plist it would make much more sense to get the AppId and AppVersion from there.

crash when send feedback on loopback pressed.

2014-11-21 11:14:11.181 Vision[2003:471386] [I] Showing email feedback with info: Feedback from settings on:<GFDebugSettingsViewController: 0x190412b0> 2014-11-21 11:14:11.456 Vision[2003:471386] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target <GFDebugSettingsViewController: 0x190412b0>.' *** First throw call stack: (0x28780d67 0x362f7c77 0x2bf07533 0x2bf0900b 0x2bd056a5 0x754b3 0x81e41 0x2bc56427 0x2bc563c9 0x2bc40fcd 0x2bc55df9 0x2bc1ab47 0x2bc4fafd 0x2bc4f3cd 0x2bc25b5d 0x78987 0x2be994e3 0x2bc2459f 0x287475e7 0x287469fb 0x28745079 0x28692981 0x28692793 0x2fa42051 0x2bc84981 0x2f8d5 0x36893aaf) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) bt * thread #1: tid = 0x7315a, 0x36958dfc libsystem_kernel.dylib__pthread_kill + 8, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x36958dfc libsystem_kernel.dylib__pthread_kill + 8 frame #1: 0x369d8d12 libsystem_pthread.dylibpthread_kill + 62 frame #2: 0x368f8938 libsystem_c.dylibabort + 76 frame #3: 0x35b05bbc libc++abi.dylibabort_message + 88 frame #4: 0x35b1f66e libc++abi.dylibdefault_terminate_handler() + 266 frame #5: 0x362f7f10 libobjc.A.dylib_objc_terminate() + 192 frame #6: 0x35b1cdee libc++abi.dylibstd::__terminate(void (*)()) + 78 frame #7: 0x35b1c8b8 libc++abi.dylib__cxa_rethrow + 100 frame #8: 0x362f7dbe libobjc.A.dylibobjc_exception_rethrow + 42 frame #9: 0x28692a1c CoreFoundationCFRunLoopRunSpecific + 632 frame #10: 0x28692792 CoreFoundationCFRunLoopRunInMode + 106 frame #11: 0x2fa42050 GraphicsServicesGSEventRunModal + 136 frame #12: 0x2bc84980 UIKitUIApplicationMain + 1440 * frame #13: 0x0002f8d4 Vision`main(argc=1, argv=0x00222a74) + 116 at main.m:16

Missing MobileCoreServices - LBFile

#import <MobileCoreServices/MobileCoreServices.h>

missing in the LBFile.m

Added the import and works fine now?
Maybe you want to submit change request ?

Framework exposes non-public headers

Headers that are used by implementation files only are currently exposed as public.
Such headers include all the AFNetworking derived headers (SLAF***.h).
Those headers should be kept as project private.

Swift Port?

Is there a swift port of this code coming? I'm building one for myself at the moment in case there isn't. I'm still a bit novice, but anyone that may be interested can check out what I have so far (and maybe help out with the port too? (= )

Direct link to the code: https://github.com/infolock/loopback-sdk-ios/tree/master/LoopBack/Swift

At this stage, the initial conversion for LBModel.swift is done, but still not yet tested. Will be trying it out tomorrow hopefully

Travis CI

Travis CI (http://travis-ci.org) integration would be great as well to know what is the state of current branches. As for now it is unclear s project in master compilable or not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.