meteor-ios icon indicating copy to clipboard operation
meteor-ios copied to clipboard

Using meteor-ios without insecure module

Open callmeahab opened this issue 9 years ago • 9 comments

Just curious if there's a way of using meteor methods for database queries or we have to use the insecure package?

callmeahab avatar Jul 02 '15 16:07 callmeahab

For queries, you'll want to subscribe to the publications you're interested in and then query the local database (either directly or through Core Data).

For updates (I think that is what you're asking), you can either use boilerplate CRUD or define your own methods. If you define your own methods, you may want to add client-side method stubs to have them participate in latency compensation.

martijnwalraven avatar Jul 02 '15 16:07 martijnwalraven

Are there examples of using boilerplate CRUD? I'm still pretty new with swift, and iOS development.

And thanks for the great work.

callmeahab avatar Jul 02 '15 21:07 callmeahab

If you're using Core Data, that would be what is used under the hood when you save a managed object context. Without it, you'd use the insert/update/remove methods on collection (see https://github.com/martijnwalraven/meteor-ios/wiki/Usage-without-Core-Data).

martijnwalraven avatar Jul 02 '15 23:07 martijnwalraven

Can ongoworks:security be used in place of insecure package?

CaptainN avatar Jul 03 '15 05:07 CaptainN

Just to be clear I'm using code from the todos example you provided, so yes I'm using Core Data and working with managed object context. When insecure package is removed on meteor, and i try to delete object from iOS app, object gets removed from Core Data and then downloaded from the server, since server side delete failed.

callmeahab avatar Jul 03 '15 09:07 callmeahab

Same issue here. Has anyone succeeded in creating/updating stuff without insecure ?

chrisscholly avatar Jun 06 '16 16:06 chrisscholly

Same issue here too, with Core Data. @callmeahab @chrisscholly Did anyone get client-side writes working from this iOS app (without the insecure package)?

holgate avatar Jul 28 '17 09:07 holgate

@holgate Not sure i remember accurately, that was 2 years ago, but don't think i got it to work without insecure package. I do remember that for that project i switched to rails backend and used websockets for syncing, something didn't work out with meteor.

callmeahab avatar Jul 28 '17 09:07 callmeahab

@callmeahab thanks for weighing in after 2yrs. I'm trying to follow @martijnwalraven suggestions, but think I'll need to see an example of how to use defineStubForMethodWithName:usingBlock: in order to solve it

holgate avatar Jul 28 '17 09:07 holgate