Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit 2720d3d

Browse files
committed
Anonymous users
1 parent 19b6949 commit 2720d3d

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ionic-service-core",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"homepage": "http://ionic.io",
55
"authors": [
66
"Eric Bobbitt <eric@drifty.com",

ionic-core.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,19 @@ function($q, $timeout, $http, persistentStorage, $ionicApp) {
425425

426426
return $http.post($ionicApp.getApiUrl() + '/api/v1/app/' + $ionicApp.getId() + '/users/identify', userData);
427427
},
428+
identifyAnonymous: function() {
429+
userData = {};
430+
userData['user_id'] = generateGuid();
431+
userData['isAnonymous'] = true;
432+
433+
// Copy all the data into our user object
434+
angular.extend(user, userData);
435+
436+
// Write the user object to our local storage
437+
persistentStorage.storeObject(storageKeyName, user);
438+
439+
return $http.post($ionicApp.getApiUrl() + '/api/v1/app/' + $ionicApp.getId() + '/users/identify', userData);
440+
},
428441
get: function() {
429442
return user;
430443
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ionic-service-core",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Ionic Core Component",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)