Git Product home page Git Product logo

corona-plugin-neura-sample's Introduction

Welcome

ย 
Type Library
Corona Store Neura
Sample Code View Sample on GitHub
Platforms Android

Overview

Neura increases user engagement and grows revenue. Neura uses artifical intelligence (AI) on data from multiple sources. We run this data through our machine learning algorithms to create insights on your user. We use these insights to trigger specific features in your app, provide your user with data on their behavior that they may otherwise not be aware of, and combine our insights with your own dataset to create even deeper insights on your users.

Corona Store Activation

In order to use this plugin, you must activate the plugin at the Corona Store.

SDK

When you build using the Corona Simulator, the server automatically takes care of integrating the plugin into your project.

All you need to do is add an entry into a plugins table of your build.settings. The following is an example of a minimal build.settings file:

settings =
{
	plugins =
	{
		-- key is the name passed to Lua's 'require()'
		["plugin.neura"] =
		{
			-- required
			publisherId = "com.neura",
		},
	},
}

Syntax

local neura = require "plugin.neura"

Register your app with Neura

Register the app

If you haven't already, create an app and fill the required information.

Declare permissions

Here you decide which pieces of user data you want Neura to provide you with, and declare the value you'll provide to the user in exchange for that data. Want to be alerted whenever 'userStartedDriving' is triggered? This is the place to ask for that.

During the authentication process, you will pass these permission requests and value propositions to Neura, and we'll ask your users to approve them when they sign in.

Connect to Neura

local function generalNeuraListener(event)
    print("Neura event: " .. event.name)
end

local firebaseParams = {
    apiKey = "FIREBASE_API_KEY",
    applicationId = "FIREBASE_APP_ID",
    gcmSenderId = "FIREBASE_GCM_SENDER_ID"
}
neura.connect({
    appUid = "APP_UID", 
    appSecret = "APP_SECRET",
    firebase = firebaseParams},
    generalNeuraListener) 

Authenticate with Neura

After connecting with neura.connect, you can initiate the Neura authentication screen.

local function authenticateListener(event)
    if event.type == "Success" then
        neura.registerFirebaseToken()
        
        local events = { ... }
        for i, v in ipairs(events) do
            neura.subscribeToEvent(v, "Identifier_"..v)
        end
    else
        print("Neura authentication failed!")
    end
end

neura.authenticate(authenticateListener)

Receiving events from Neura

There are 2 options where you can receive events from Neura.

You'll need to define which way you want to receive the event, and declare it in the "TECH INFO" section when creating an application.

  1. Firebase Cloud Messaging: Neura will send you an event to a service you declared on your manifest. If you don't have a server side, this is the only way you can receive an event.
  2. Webhook: Neura will send an event to the url specified, and you will have to decide what to do with the event.

corona-plugin-neura-sample's People

Contributors

deleurapps avatar

Watchers

 avatar  avatar

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.