hmott's Forum Posts

  • Here's where I read about it, starting in the "Documentation" section in this link:

    https://documentation.onesignal.com/v2. ... tification

    The rest API key when logged in is here:

    App Settings > Keys & ID's.

    Hope that helps.

  • What kind of examples do you wanna see in the capx file?

    What do you mean with the rest api key? The one you insert in the plugin properties? Or the unique one the device has to make push by itself?

    The plugin properties uses the app id provided by OneSignal. They also provide an api key, which they recommend be stored and used on a server instead of an app user's device. In the app, I can add tags to a user through your plugin, but if I want to send out a push from a client's device to target other users based on their tags, that request needs to include the api key on top of the app id.

    Maybe the api key can be added to the plugin properties like the app id and google project # in a safe way?

    As for the example capx, maybe something simple that shows how the conditions/actions/expressions are used in context of a simple app that relies on notifications. See rex's plugins and their examples for inspiration...

  • I've just completed the installation and it worked for Android via intel xdk. Great to see it working properly, nice job!

    Could you make a sample capx file showing the plugin in action? That would be helpful.

    Also, regarding the 'tags' feature, the website says pushes with 'tags' require the REST api key with the request. Then it also warns about having the api key stored on the client device. Is there a workaround for this?

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi, just got your plugin. Hoping it does the trick.

    I added the google play services to intel xdk. They changed the name to com.google.playservices from cordova-google-play-services.

    Hope that helps.

    Cheers,

    hgm

  • In c2 you have to "get location". Then use the same trigger.

  • On your phone go to settings > apps > (your app) > permissions.

  • Hi all, I'm trying to get geolocation to work on Android/Intel xdk. When I make changes, and reinstall on my device, it works perfectly at first. Shortly after, the plugin gets stuck trying to get a location. Any way to get it working reliably?

    Thanks

    [Edit]

    The steps below seem to have fixed the issue. Now the stock geolocation plugin works on my nexus 5x (running official android 'N' beta). Geolocation has become much more intricate with these new phones. It can determine the location from GPS and GLANOS satellites, cell towers, wifi, etc. The location setting can also be modified on the phone to use all sources (high accuracy) or satellites only. With these hardware upgrades, the software still works, with the following method:

    Intel XDK:

    • Add the latest geolocation plugin (v2.2.0, this automatically adds an additional 'compat' plugin).

    C2 'geolocation' plugin:

    • open the plugin folder (Construct 2\exporters\html5\plugins\geolocation)
    • in the 'geolocation' folder open the 'edittime' java file (best to do with notepad++, notepad-plus-plus.org)

    'geolocation plugin:

    • look for this line: "rotatable": false, // only used when "type" is "world". Enables an angle property on the object.
    • enter this line under it: "cordova-plugins": "org.apache.cordova.geolocation"

    C2:

    • When getting a new location use "High accuracy". I set the timeout to ten seconds.
    • During export I don't check "New Intel xdk project format", but I do check the "geolocation" permission.
    • I haven't tried the minify script, so I'm not sure if it would have any effect.

    It may not all be necessary, but this method made it work for my app on my device.

  • Hi Rex, I'm having trouble with the firebase query function.

    Here is the setup [plugin used]:

    (action) [Query] 0. Create a new query for ref X

    (action) [Query] 1. Order current query by Key

    (action) [Firebase] Add received callback: "Tag" once for query [Query] (child added)

    Here is the response [plugin used]:

    (condition) [Firebase] On received "Tag"

    (condition) [Query] LastData is null

    I get the following popup error on during app startup before the app finishes loading:

    "Assertion failure: Condition method appears to be missing, check ACE table names match script names."

    Same error caused by

    (condition) [Query] On received "Tag"

    I have the FirebaseAPI plugin installed.

    Also, I can't seem to find a way of receiving a reply from firebase if a text entry is missing. When there is data, [Firebase] On received "Tag" triggers a response, but not when it doesn't find a match. Any ideas?

  • Nice, thanks! The dropbox link seems to be broken.

  • hmott

    Try re-download rex_firebase plugin again. I am not sure why the function could not be found in your environment.

    That did it!

    Thanks!

  • hmott

    Could you paste the error message of using "order by value"? Is it the same as previous testing from your post?

    I've updated the post with the error and the code that creates it. Hope it helps.

  • hmott

    Update rex_firebase_query plugin, and

    Here is a sample capx, remember fill your firebase url in "BASE" constant value.

    I only could prove this order by value is worked, but I don't know why it is failed in your case, this bug should not appear imo.

    I don't understand... I updated the plugin and tried the sample file you provided.

    The only thing I changed was the BASE url like you instructed. Writing to my database from your sample file works, but the query function is in error.

    Here's the code that makes the error:

    Does it work for you?

    *** Update ***

    I've been able to get it to work if searching for the key ("a" through "d" in your example). Also, adding the "Data is null" condition triggers correctly when searching for non-existing key "e", for example.

    Attached is a screenshot of what does work (when BASE url filled in: https://<appname>.firebaseio.com).

    http://postimg.org/image/4mh8nxv6r

    This is good enough for me. Even if I can't search for value, I can at least define and search for the key whether it exists or not. I can then use another query call to get the value if needed.

    Thanks again for your help.

  • Having some trouble querying by value. I keep getting this error:

    http://postimg.org/image/ijdesneq1

    Here's the code I'm using (see 3rd image that define variable names):

    http://postimg.org/image/rsrflnxij

    Here's the firebase data:

    http://postimg.org/image/rakdnjhxj

    Any ideas? Thanks.

  • Update - rex_firebase_query plugin, add "Action:Order by value".

    hmott

    Since the data structure in firebase is dictionary, add the key in path will get the respond value if the key is exited.

    To search keys which has a specific value, you could use "Action:Order by value" ( sorry I had missed this action ),

    [quote:2bsr330t]create query

    order by value

    equal to -

    then a 1d dictionary will be received.

    Thanks for such a quick update!

  • Hi Rex, is there a way to search for a key or value in firebase without knowing if they exist? It seems the plugins crash when searching. I tried the query and filter plugins. Any ideas?

    I'm want to use fb for one user to enter a title (fb key) and text (fb value). Then enable another user to search for the title. If the title exists, I'd like the second user to download the text linked to the title.

    Thanks