Skip to content

Commit

Permalink
Deploying 3.2.0 to public repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Appboy CI committed Feb 26, 2021
1 parent 798246c commit bded5d0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,15 @@
## 3.2.0

##### Added
- Added an optional `parentNode` parameter to [`appboy.display.hideContentCards`](https://js.appboycdn.com/web-sdk/latest/doc/modules/appboy.display.html#hidecontentcards) that allows you to specify a particular Content Cards feed to hide.

##### Changed
- Cookies set by the SDK are now renewed when a new session is started. This fixes an issue where the SDK would stop setting cookies that had been deleted or expired when identification information existed in localStorage, preventing cross-subdomain identification from functioning in certain circumstances.
- Increased clickable area of all buttons in the built-in UI to be at least 45x45px to comply with mobile accessibility best-practices. This includes some minor changes to the Content Cards and News Feed UI to accommodate the larger buttons.

##### Fixed
- Fixed an issue where some network requests fail on websites using certain libraries that overwrite the native Promise object.

## 3.1.2

##### Fixed
Expand Down
26 changes: 13 additions & 13 deletions README.md
Expand Up @@ -2,7 +2,7 @@

Effective marketing automation is an essential part of successfully scaling and managing your business. Braze empowers you to build better customer relationships through a seamless, multi-channel approach that addresses all aspects of the user life cycle. Braze helps you engage your users on an ongoing basis. We'll have you up and running in no time!

- [Read the full technical documentation](https://js.appboycdn.com/web-sdk/3.1/doc/modules/appboy.html)
- [Read the full technical documentation](https://js.appboycdn.com/web-sdk/3.2/doc/modules/appboy.html)

# Getting Started

Expand Down Expand Up @@ -36,7 +36,7 @@ Alternatively, you can skip installing the service worker from NPM and download

```javascript
// service-worker.js
self.importScripts('https://js.appboycdn.com/web-sdk/3.1/service-worker.js');
self.importScripts('https://js.appboycdn.com/web-sdk/3.2/service-worker.js');
```

## TypeScript Support
Expand All @@ -45,7 +45,7 @@ As of 3.0.0, the Braze Web SDK includes types with the `@braze/web-sdk` package.

## Alternative CDN installation

If you don't use npm or you prefer not to load the SDK through a package manager, you can load it through our CDN in your HTML. Put the following snippet in the `<head>` section of your page to asynchronously download https://js.appboycdn.com/web-sdk/3.1/appboy.min.js and open a Braze session:
If you don't use npm or you prefer not to load the SDK through a package manager, you can load it through our CDN in your HTML. Put the following snippet in the `<head>` section of your page to asynchronously download https://js.appboycdn.com/web-sdk/3.2/appboy.min.js and open a Braze session:

<!--- UPDATE THESE LOADING SNIPPETS IN THE SAMPLE BUILD APP'S INDEX.HTML WHEN YOU CHANGE THEM!!
For context, these are largely standard "load js from js" snippets - the basic approach is to create a script
Expand All @@ -62,7 +62,7 @@ If you don't use npm or you prefer not to load the SDK through a package manager
```
<script type="text/javascript">
+function(a,p,P,b,y){a.appboy={};a.appboyQueue=[];for(var s="DeviceProperties Card Card.prototype.dismissCard Card.prototype.removeAllSubscriptions Card.prototype.removeSubscription Card.prototype.subscribeToClickedEvent Card.prototype.subscribeToDismissedEvent Banner CaptionedImage ClassicCard ControlCard ContentCards ContentCards.prototype.getUnviewedCardCount Feed Feed.prototype.getUnreadCardCount ControlMessage InAppMessage InAppMessage.SlideFrom InAppMessage.ClickAction InAppMessage.DismissType InAppMessage.OpenTarget InAppMessage.ImageStyle InAppMessage.Orientation InAppMessage.TextAlignment InAppMessage.CropType InAppMessage.prototype.closeMessage InAppMessage.prototype.removeAllSubscriptions InAppMessage.prototype.removeSubscription InAppMessage.prototype.subscribeToClickedEvent InAppMessage.prototype.subscribeToDismissedEvent FullScreenMessage ModalMessage HtmlMessage SlideUpMessage User User.Genders User.NotificationSubscriptionTypes User.prototype.addAlias User.prototype.addToCustomAttributeArray User.prototype.getUserId User.prototype.incrementCustomUserAttribute User.prototype.removeFromCustomAttributeArray User.prototype.setAvatarImageUrl User.prototype.setCountry User.prototype.setCustomLocationAttribute User.prototype.setCustomUserAttribute User.prototype.setDateOfBirth User.prototype.setEmail User.prototype.setEmailNotificationSubscriptionType User.prototype.setFirstName User.prototype.setGender User.prototype.setHomeCity User.prototype.setLanguage User.prototype.setLastKnownLocation User.prototype.setLastName User.prototype.setPhoneNumber User.prototype.setPushNotificationSubscriptionType InAppMessageButton InAppMessageButton.prototype.removeAllSubscriptions InAppMessageButton.prototype.removeSubscription InAppMessageButton.prototype.subscribeToClickedEvent display display.automaticallyShowNewInAppMessages display.destroyFeed display.hideContentCards display.showContentCards display.showFeed display.showInAppMessage display.toggleContentCards display.toggleFeed changeUser destroy getDeviceId initialize isPushBlocked isPushGranted isPushPermissionGranted isPushSupported logCardClick logCardDismissal logCardImpressions logContentCardsDisplayed logCustomEvent logFeedDisplayed logInAppMessageButtonClick logInAppMessageClick logInAppMessageHtmlClick logInAppMessageImpression logPurchase openSession registerAppboyPushMessages removeAllSubscriptions removeSubscription requestContentCardsRefresh requestFeedRefresh requestImmediateDataFlush resumeWebTracking setLogger stopWebTracking subscribeToContentCardsUpdates subscribeToFeedUpdates subscribeToInAppMessage subscribeToNewInAppMessages toggleAppboyLogging trackLocation unregisterAppboyPushMessages wipeData".split(" "),i=0;i<s.length;i++){for(var m=s[i],k=a.appboy,l=m.split("."),j=0;j<l.length-1;j++)k=k[l[j]];k[l[j]]=(new Function("return function "+m.replace(/\./g,"_")+"(){window.appboyQueue.push(arguments); return true}"))()}window.appboy.getCachedContentCards=function(){return new window.appboy.ContentCards};window.appboy.getCachedFeed=function(){return new window.appboy.Feed};window.appboy.getUser=function(){return new window.appboy.User};(y=p.createElement(P)).type='text/javascript';
y.src='https://js.appboycdn.com/web-sdk/3.1/appboy.min.js';
y.src='https://js.appboycdn.com/web-sdk/3.2/appboy.min.js';
y.async=1;(b=p.getElementsByTagName(P)[0]).parentNode.insertBefore(y,b)
}(window,document,'script');
Expand All @@ -72,15 +72,15 @@ If you don't use npm or you prefer not to load the SDK through a package manager
/*
* If you have a unique identifier for this user (e.g. they are logged into your site) it's a good idea to call
* changeUser here.
* See https://js.appboycdn.com/web-sdk/3.1/doc/modules/appboy.html#changeuser for more information.
* See https://js.appboycdn.com/web-sdk/3.2/doc/modules/appboy.html#changeuser for more information.
*/
// appboy.changeUser(userIdentifier);
appboy.openSession();
</script>
```

**Be sure to replace "YOUR-API-KEY-HERE" with your API key!** This snippet will provide a global variable [`appboy`](https://js.appboycdn.com/web-sdk/3.1/doc/modules/appboy.html) that you can use to send data to the Braze API.
**Be sure to replace "YOUR-API-KEY-HERE" with your API key!** This snippet will provide a global variable [`appboy`](https://js.appboycdn.com/web-sdk/3.2/doc/modules/appboy.html) that you can use to send data to the Braze API.

## Alternative Google Tag Manager installation

Expand All @@ -89,7 +89,7 @@ If you are using Google Tag Manager, you should use the following loading snippe
```
<script type="text/javascript">
+function(a,p,P,b,y){a.appboy = {};a.appboyQueue = [];var s = ["DeviceProperties", "Card", "Card.prototype.dismissCard", "Card.prototype.removeAllSubscriptions", "Card.prototype.removeSubscription", "Card.prototype.subscribeToClickedEvent", "Card.prototype.subscribeToDismissedEvent", "Banner", "CaptionedImage", "ClassicCard", "ControlCard", "ContentCards", "ContentCards.prototype.getUnviewedCardCount", "Feed", "Feed.prototype.getUnreadCardCount", "ControlMessage", "InAppMessage", "InAppMessage.SlideFrom", "InAppMessage.ClickAction", "InAppMessage.DismissType", "InAppMessage.OpenTarget", "InAppMessage.ImageStyle", "InAppMessage.Orientation", "InAppMessage.TextAlignment", "InAppMessage.CropType", "InAppMessage.prototype.closeMessage", "InAppMessage.prototype.removeAllSubscriptions", "InAppMessage.prototype.removeSubscription", "InAppMessage.prototype.subscribeToClickedEvent", "InAppMessage.prototype.subscribeToDismissedEvent", "FullScreenMessage", "ModalMessage", "HtmlMessage", "SlideUpMessage", "User", "User.Genders", "User.NotificationSubscriptionTypes", "User.prototype.addAlias", "User.prototype.addToCustomAttributeArray", "User.prototype.getUserId", "User.prototype.incrementCustomUserAttribute", "User.prototype.removeFromCustomAttributeArray", "User.prototype.setAvatarImageUrl", "User.prototype.setCountry", "User.prototype.setCustomLocationAttribute", "User.prototype.setCustomUserAttribute", "User.prototype.setDateOfBirth", "User.prototype.setEmail", "User.prototype.setEmailNotificationSubscriptionType", "User.prototype.setFirstName", "User.prototype.setGender", "User.prototype.setHomeCity", "User.prototype.setLanguage", "User.prototype.setLastKnownLocation", "User.prototype.setLastName", "User.prototype.setPhoneNumber", "User.prototype.setPushNotificationSubscriptionType", "InAppMessageButton", "InAppMessageButton.prototype.removeAllSubscriptions", "InAppMessageButton.prototype.removeSubscription", "InAppMessageButton.prototype.subscribeToClickedEvent", "display", "display.automaticallyShowNewInAppMessages", "display.destroyFeed", "display.hideContentCards", "display.showContentCards", "display.showFeed", "display.showInAppMessage", "display.toggleContentCards", "display.toggleFeed", "changeUser", "destroy", "getDeviceId", "initialize", "isPushBlocked", "isPushGranted", "isPushPermissionGranted", "isPushSupported", "logCardClick", "logCardDismissal", "logCardImpressions", "logContentCardsDisplayed", "logCustomEvent", "logFeedDisplayed", "logInAppMessageButtonClick", "logInAppMessageClick", "logInAppMessageHtmlClick", "logInAppMessageImpression", "logPurchase", "openSession", "registerAppboyPushMessages", "removeAllSubscriptions", "removeSubscription", "requestContentCardsRefresh", "requestFeedRefresh", "requestImmediateDataFlush", "resumeWebTracking", "setLogger", "stopWebTracking", "subscribeToContentCardsUpdates", "subscribeToFeedUpdates", "subscribeToInAppMessage", "subscribeToNewInAppMessages", "toggleAppboyLogging", "trackLocation", "unregisterAppboyPushMessages", "wipeData"];for (var i = 0; i < s.length; i++) { var m = s[i]; var k = a.appboy; var l = m.split("."); for (var j = 0; j < l.length - 1; j++) { k = k[l[j]]; } k[l[j]] = new Function("return function " + m.replace(/\./g, "_") + "(){window.appboyQueue.push(arguments); return true}")();}window.appboy.getCachedContentCards = function() { return new window.appboy.ContentCards(); };window.appboy.getCachedFeed = function() { return new window.appboy.Feed(); };window.appboy.getUser = function() { return new window.appboy.User(); };(y=p.createElement(P)).type='text/javascript';
y.src='https://js.appboycdn.com/web-sdk/3.1/appboy.min.js';
y.src='https://js.appboycdn.com/web-sdk/3.2/appboy.min.js';
y.async=1;(b=p.getElementsByTagName(P)[0]).parentNode.insertBefore(y,b)
}(window,document,'script');
Expand All @@ -99,7 +99,7 @@ window.appboy.display.automaticallyShowNewInAppMessages();
/*
* If you have a unique identifier for this user (e.g. they are logged into your site) it's a good idea to call
* changeUser here.
* See https://js.appboycdn.com/web-sdk/3.1/doc/modules/appboy.html#changeuser for more information.
* See https://js.appboycdn.com/web-sdk/3.2/doc/modules/appboy.html#changeuser for more information.
*/
// window.appboy.changeUser(userIdentifier);
Expand All @@ -111,7 +111,7 @@ All Braze activity on initial page view should be in this tag. Subsequent tags w

## Alternative RequireJS installation

Alternatively, you can use RequireJS or another AMD module-loader to load the Braze Web SDK. In this scenario, we recommend hosting a copy of https://js.appboycdn.com/web-sdk/3.1/appboy.min.js alongside your other self-hosted JavaScript resources, or utilizing your module-loader's packaging/optimization features to package the Braze library inside of your other JavaScript. This prevents the require call from failing when the library is blocked by strict corporate firewalls or ad blockers. If you opt for this route, please be sure to watch [our Github repository](https://github.com/Appboy/appboy-web-sdk/releases) ([or the release feed](https://github.com/Appboy/appboy-web-sdk/releases.atom)) to stay aware of critical bugfixes and upgrades.
Alternatively, you can use RequireJS or another AMD module-loader to load the Braze Web SDK. In this scenario, we recommend hosting a copy of https://js.appboycdn.com/web-sdk/3.2/appboy.min.js alongside your other self-hosted JavaScript resources, or utilizing your module-loader's packaging/optimization features to package the Braze library inside of your other JavaScript. This prevents the require call from failing when the library is blocked by strict corporate firewalls or ad blockers. If you opt for this route, please be sure to watch [our Github repository](https://github.com/Appboy/appboy-web-sdk/releases) ([or the release feed](https://github.com/Appboy/appboy-web-sdk/releases.atom)) to stay aware of critical bugfixes and upgrades.

```
require(['path/to/appboy'], function(appboy) {
Expand All @@ -125,13 +125,13 @@ require(['path/to/appboy'], function(appboy) {

## Alternative No AMD installation

If your site uses RequireJS or another AMD module-loader, but you prefer to load the Braze Web SDK through one of the other options above, you can load a version of the library that does not include AMD support. This version of the library is available at `https://js.appboycdn.com/web-sdk/3.1/appboy.no-amd.min.js`. You can also find it on [npm](https://www.npmjs.com/package/@braze/web-sdk-no-amd).
If your site uses RequireJS or another AMD module-loader, but you prefer to load the Braze Web SDK through one of the other options above, you can load a version of the library that does not include AMD support. This version of the library is available at `https://js.appboycdn.com/web-sdk/3.2/appboy.no-amd.min.js`. You can also find it on [npm](https://www.npmjs.com/package/@braze/web-sdk-no-amd).

## Core Library (no UI for In-App Messages or Content Cards)

If you don't intend to use Braze's built-in UI capabilities (any [appboy.display](https://js.appboycdn.com/web-sdk/3.1/doc/module-display.html) methods), you can load a core version of the
If you don't intend to use Braze's built-in UI capabilities (any [appboy.display](https://js.appboycdn.com/web-sdk/3.2/doc/module-display.html) methods), you can load a core version of the
library with display capabilities stripped. However, you will need to implement your own UI for In-App Messaging and Content Cards. Note that our UI elements are fully customizable via css, so we generally recommend integration
of the complete library instead. The core library is available at `https://js.appboycdn.com/web-sdk/3.1/appboy.core.min.js` or on [npm](https://www.npmjs.com/package/@braze/web-sdk-core).
of the complete library instead. The core library is available at `https://js.appboycdn.com/web-sdk/3.2/appboy.core.min.js` or on [npm](https://www.npmjs.com/package/@braze/web-sdk-core).

# SDK Endpoint

Expand All @@ -140,7 +140,7 @@ Be sure to use the correct [SDK endpoint](https://www.braze.com/docs/user_guide/
# Debugging / Troubleshooting

Pass the option `enableLogging: true` to the initialize function (`appboy.initialize('YOUR-API-KEY-HERE', { baseUrl: 'YOUR-SDK-ENDPOINT', enableLogging: true });`) to cause Braze to log to the javascript console. This is valuable for development but is visible to all users,
so remove this option or [provide an alternate logger](https://js.appboycdn.com/web-sdk/3.1/doc/modules/appboy.html#setlogger) before you
so remove this option or [provide an alternate logger](https://js.appboycdn.com/web-sdk/3.2/doc/modules/appboy.html#setlogger) before you
release your page to production.

## Version Support
Expand Down

0 comments on commit bded5d0

Please sign in to comment.