Parse.com plugin v2

Hi,

Hmm. So it makes sense that it should work if you’re allowing the user to delete their own account. I assume they are logged in at that time?

I think you’ll need to send off the user delete call first from Corona, and use Parse Cloud code to remove the session. https://parse.com/docs/cloudcode/guide#cloud-code-afterdelete-triggers

You won’t to need to do anything special for Parse to trigger the hook (except delete the user). That make sense?

Cheers.

I’d love to tell you that it worked, but alas…

I read the docs you referred to and used the following afterDelete trigger:

Parse.Cloud.afterDelete(Parse.User, function(request) { Parse.Cloud.useMasterKey(); query = new Parse.Query("Session"); query.equalTo("user", request.object); query.find({ success: function(sessions) { Parse.Object.destroyAll(sessions, { success: function() { console.log("Session deleted") }, error: function(error) { console.error("Error deleting related sessions " + error.code + ": " + error.message); } }); }, error: function(error) { console.error("Error finding related sessions " + error.code + ": " + error.message); } }); });

Notice the “Parse.Cloud.useMasterKey();” that I had to add for the function to execute without errors. I created a test user, deleted it and the the cloud code log said “Session deleted” (as per my console.log printout in the code) but the session was in fact NOT deleted. It was still there. In my face.

I’m really beginning to seriously dislike Parse.

Somehow this seems so strange. I mean, I can’t be the only Parse customer/victim who wants to delete a user? How do you guys do this? I’m starting to think I’m missing something on a more conceptual level here…

Hello !

Your work is awesome ! I discovered Parse mod 1 week ago and it was a very good experience. 

But I have a problem with your new plugin, I can’t download it using your publisherId = “develephant.com” in my build.settings.

Anyway thanks a lot with your great work !

Hi,

Thanks for the kind words.  The Parse plugin has not been released yet. It’s done, but going through the submission process now.

Should be soon!

Cheers.

I’m happy to announce that the Parse plugin for Corona SDK has been officially released.  :smiley:

https://store.coronalabs.com/plugin/parse

Support at http://support.coronium.io

Enjoy.

And… there was much rejocing!!!

Rob

…as long as it works.  :ph34r:

Thank you very much develephant…amazing work as always!!!

One question…can I use push notifications now with Parse and Android?

Thank you in advance.

Best regards,

Erich Grüttner D.

Hi,

Yes. Everything from the REST API is accessible. Take a look at these docs.

http://parse.develephant.com/CH2_Usage/#examples (Look at the “Creating an Installation” section)

https://www.parse.com/docs/rest/guide#push-notifications-uploading-installation-data (Look at the Android specifics).

Be sure to read through the developer guide on parse.develephant.com.

Cheers.

Hi,

Assuming I did everything properly, a new update to the Parse plugin should be propagating.

New additions include Macros and Batch Operations.

This update was generously sponsored by Nick (nmichaud) here on the forums. Thanks Nick!

If you find this plugin useful, consider a sponsor donation. You’ll even get your name on the sponsor list. :slight_smile:

Enjoy.

Hi develephant,

thank you for the huge contribution.

I am an Enterprise SDK user, and I was thinking to use Parse as native plugin, but then I saw your plugin and the positive comments about. so can you please help me figure it out.

  • can/how Enterprise user can use your plugin?

  • is there difference in performance between native plugin and REST API plugin, e.g. delay time?

  • and if possible are there complete examples for downloading parse Files and Parse.Config?

I will deeply appreciate prompt answer as I already working on it,

Thank you.`

Hi,

To answer your questions the best I can:

  1. I have no idea how to integrate the plugins with Enterprise projects. Hopefully someone from CoronaLabs will help answer that one.

  2. Again, not ever using a native plugin, I can’t really say. My guess is the network transfer speed isn’t going to change much, but there may be some caching benefits using a native plugin. Security may be more tightly integrated to the phone, etc.

  3. What kind of examples are you looking for specifically? Parse.Config works just like a regular Parse.Object. Managing files is up to each developers system. Downloading them is just a simple act of providing the uri that you receive from Parse.

My guess is a lot of the native plugins use the REST API as well, just in a more indirect way.

Hope some of that helps.

Cheers.

wow, thank you for the real time answer :slight_smile:

is the plugin a pure lua? 

I will check with @CoronaGuys. can anyone hear me here, to make answer clear for all.

for the file example, my use case is very simple I want to set static files in Parse server, and make user download them, without to be able to upload or remove files?

for the config File as I understand, there is one REST API call that return all Paramters as json file, which should be stored locally to be later used, is that correct?

Thank you again and again :slight_smile:

Hi,

Plugin is pure Lua. But Corona also adds a compilation step to the files. I’m not sure how that affects Enterprise use.

I have never uploaded files to Parse in advance, is that a newer feature? or were you thinking of uploading them from the desktop client? It’s really just a matter of creating an “Image” class and making sure to store the uri you receive from Parse after upload.

There are many ways to handle a “config” file. I believe Parse provides the Config class just to help give it structure. Because, again, it’s really no different than if you created your own “Config” class on Parse.

When you are using the Corona Parse plugin, all results are returned in a table. You can store that incoming “Config” table in your app for later use (however you decide to enable it). There is no need to think about the JSON part.

Hope that helps.

Cheers.

Hey,

yes I thought to upload them from “Master” client and then associate them with object that gives name to file-id mapping.

is the compiled lua file public?

Thank you.

Hi,

 

https://bitbucket.org/coronalabs/store-hosted-parse/src/d36a202b1ebb/plugins/2015.2642/lua/lua_51/?at=default

 

I think that it is at that url.

 

Cheers.

I’ve asked engineering…

Rob

You should be able to drop the “plugin” folder into your project (the Corona folder in your Enterprise solution) using Develephant’s link above.

Thank you Guys,

so far so great.

develephant, last two questions, I think will be interesting for many guys:

  • I saw in some place that in order to use Push notification (register users to channel, and later send them notification from Parse server) there is a need to use parse SDK, how that works with the parse plugin?

  • In general, if we found for some reason that we need to implement some parse functionality in native plugin, would that Co-exist with the parse plugin?

thank you for your time

and for your helpful answers.

Hi,

Parse eventually added the ability to handle Android registrations in the REST API, so that is completely supported in the plugin.

Though I have no concrete evidence, I don’t think you should have any issues using both if needed.

Hope that helps.

Cheers.