Giter VIP home page Giter VIP logo

ember-braze's Introduction

ember-braze (formerly ember-appboy)

Build Status Ember Observer Score Code Climate

ember-braze exposes the appboy-web-sdk to your Ember app (a.k.a braze-web-sdk).

Installation

ember install ember-braze

Usage

Please check out the interactive docs for usage information.

Rename

Appboy changed their name to Braze in 2017. The former addon (ember-appboy) was deprecated and users asked to use ember-braze instead. Within the code, all references to the SDK still use appboy, because a rename in their SDK has not yet happened. This addon will follow their lead. When their code references braze instead of appboy, we will change that on our end. Semantic versioning will be followed to try to prevent thrash to end users.

Legal

This addon is in no way affiliated with Braze. It is developed by Ben Limmer and is simply a wrapper around the appboy-web-sdk to make integration with Ember apps simple.

Developing

  • git clone <repository-url> this repository
  • cd ember-braze
  • yarn install

Running

Running Tests

  • yarn test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

ember-braze's People

Contributors

blimmer avatar ember-tomster avatar gorner avatar trevorrjohn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

gorner

ember-braze's Issues

Add stub-api smoke tests

As discussed here, there is a stub api you can run locally to simulate interaction with the appboy API.

As we saw with the minification bug #14 , some issues are only exposed when interacting with the real api. It would be a great improvement to add a smoke test suite that starts up the stub-api server on the CI machine and runs tests against it.

[Enhancement] Better support for hash fragments

Most of the Ember apps my team is responsible for currently use the location: 'hash' option and the production versions of these apps are hosted in subdirectories, so a typical URL would be in the format "https://www.example.com/foo/bar/index/html#/baz".

For various reasons external to this issue, some of our internal links cannot be specified as Ember {{link-to}} calls and instead have to be hardcoded, as in <a href="...">. One of the implications of the location: 'hash' setting is that these href values have to be specified as hash fragments, i.e. "#/baz" instead of "/baz", in order to work properly.

For consistency for our team, we would like to be able to have Braze modal buttons be able to support URLs in the hash-fragment format. This is not possible with the current implementation of getAppRoute, which simply uses the pathname from the parsed URI, which in the case of the example above will simply be the user's current (pre-hash) URL.

The workaround is of course to not use the '#' character in the Braze link targets in this scenario. However I believe this is a useful enhancement that (if implemented correctly) should not impede other uses.

I am working on a potential fix and will submit as a PR shortly.

Create promisifed methods for methods with callbacks

There are a few methods in the appboy library that take anonymous functions as callbacks:

To better integrate these with Ember, we should expose methods that bind to the Ember run loop and return an RSVP promise. For instance:

// addon/utils/promisified-methods.js

export function rsvpIsPushGranted(safariPushId) {
   ... logic ...
   ... returns a promise ...
}

Add config flag to turn on debug logging

You can pass enableLogging: true to the initialize call to get debug logging. This could be a useful feature.

enableLogging - Set to true to enable logging by default. Note that this will cause Appboy to log to the
javascript console, which is visible to all users! You should probably remove this or provide an alternate
logger with appboy.setLogger() before you release your page to production.

https://js.appboycdn.com/web-sdk/latest/doc/module-appboy.html#.initialize

Check URI Path with Ember Router

Right now, I assume that if the URI you're transition to is within the same hostname, it is a valid route in your ember app. However, it's possible that your ember app does not span the whole boundary of your hostname.

It would be nice if we could somehow ask the router if it recognizes a URI path and only wire up our soft transition logic in this case.

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.