Coder Social home page Coder Social logo

ionic-service-core's Introduction

NOTICE:

This library has been deprecated by the ionic-platform-web-client.

Head over to our docs to learn more about setting up a project with the Ionic Platform.

ionic-service-core's People

Contributors

ericb avatar fuiste avatar jamiesonwarner avatar jskrzypek avatar mlynch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ionic-service-core's Issues

code inside $ionicPlatform.ready(...) does not have access to window.cordova

ionic-core-service will bootstrap cordova.js inside it's run method with $ionicApp.bootstrap(), which means that until this has run, the callback passed to $ionicPlatform.ready(...) will not find the window.cordova object via ionic.Platform.isWebView() and the will be $ionicPlatform.ready() callbacks will be triggered only in response to the window.on("load",...) event, bypassing cordova's "deviceready" entirely (https://github.com/driftyco/ionic/blob/master/js/utils/platform.js#L402)

A workaround is currently possible by wrapping code that needs window.cordova with document.addEventListener("deviceready", ...) inside the$ionicPlatform.ready(...)`

0.1.9 TAG hardcodes app_id 9977a467 in $ionicCoreSettings

It seems that the 0.1.9 tag isn't consistent with the ionic-core.js although they were updated the same day.

In $ionicCoreSettings for the tag 0.1.9, theres a hardoded app_id and public key, and since this app_id, api_key is checked before ionicApp, everyones events will get forwarded to this app_id rather than their own..

May need to do another bower patch to fix this issue since bower pulls from the GIT tags.

Ionic Deploy Deployment Loop (constant refresh of index.html after receiving update from Deploy)

Having this issue after a deploy is pushed to a device.

After the deploy has installed, there is a constant refresh of the index.html page,
even after the app has been killed and restarted.

The issue is very similar to the example in the link below.

Has anyone else seen this and maybe have come up with a solution?

This is how the code has been implemented:

//check if app is running in the browser
            //if it is not, check for updates
            if (ionic.Platform.device().available) {
              $ionicDeploy.setChannel(CONSTANTS.CUR_ENV);
              console.log('You are currently pulling from: ' + $ionicDeploy.channel_tag);
            console.log('Ionic Deploy: Checking for updates');
            $ionicDeploy.check().then(function (hasUpdate) {
              console.log('Ionic Deploy: Update available: ' + hasUpdate);
              $scope.hasUpdate = hasUpdate;
              // Update app code with new release from Ionic Deploy
              $ionicDeploy.update().then(function (res) {
                console.log('Ionic Deploy: Update Success! ', res);
              }, function (err) {
                console.log('Ionic Deploy: Update error! ', err);
              }, function (prog) {
                console.log('Ionic Deploy: Progress... ', prog);
              });
            }, function (err) {
              console.error('Ionic Deploy: Unable to check for updates', err);
            });
          } else {
            console.log('*** running in the browser, not checking for update');
          }
        }
      });

Another more detailed example can be found here: Deploy Loop Issue

Module 'ionic.service.core' is not available!

Hi guys
I'm trying to run an ionic v1 app and got this message:
Error: [$ injector: modulerr] Failed to instantiate module ionic.service.core due to:
Error: [$ injector: nomod] Module 'ionic.service.core' is not available!

When I try to install with the command
bower install ionic-service-core

I have this error message:
fatal: repository 'https://github.com/driftyco/ionic-platform-web-client.git/' not found

Does anyone know how to install this module differently?

Thankful

$ionicAppProvider.identify() yields SyntaxError: Unexpected token o in ionic-core.js:162:29

Hi,

I try to connect my app to ionic.io by adding the ionic-service-core module via ionic add ionic-service-core\#master and adding this to my app's code:

.config([ '$ionicAppProvider', function($ionicAppProvider) {
  $ionicAppProvider.identify({
    app_id : 'MY_ADD_ID',
    api_key : 'MY_API_KEY'
  });
} ])

Unfortunately, this fails because in this line, the response data already seems to be parsed and so the JSON.parse() call fails.

Output of ionic info:

OS: Mac OS X Yosemite
Node Version: v0.10.33
Cordova CLI: 4.3.0
Ionic CLI Version: 1.3.20
Xcode version: Xcode 6.3 Build version 6D570
ios-sim version: 3.0.0
ios-deploy version: Not installed

Thanks,
Jan.

Could not satisfy the request's Accept header

I have an Ionic app which consumes a large number of XML ReST requests using Basic Authorization.

If you override Angular's default HTTP service to use an alternate default 'Accept' header, $ionicUser.identify() fails with the following response:

{
    "config": {
        "data": {
            "_id": "XXXX",
            "device": {
                "screen_height": 1334,
                "screen_width": 750
            },
            "is_on_device": true,
            "user_id": "XXXX"
        },
        "headers": {
            "Accept": "application/xml",
            "Authorization": "Basic YYYY",
            "Content-Type": "application/json;charset=utf-8"
        },
        "method": "POST",
        "transformRequest": [
            null
        ],
        "transformResponse": [
            null
        ],
        "url": "https://apps.ionic.io/api/v1/app/XXXX/users/identify"
    },
    "data": {
        "detail": "Could not satisfy the request's Accept header"
    },
    "status": 406,
    "statusText": "NOT ACCEPTABLE"
}

$ionicUser (and potentially other apps.ionic.io tools) should probably explicitly ask for the Accepts: header it expects when making API calls.

As a workaround, I have changed my code to not override the default Accept: header and instead set it per-request, for now.

Pull ionic services in common modules and create AngularJS adaptors

Hi,

I was thinking that all the offering you are working on has no real hard dependencies on angular.

It would be beneficial to abstract away in a common module each service and then have an adaptor for angular. Then the community can contribute different adaptors to leverage those services in other frameworks.

And for you, it means you can offer your services to a larger crowd.

Any though ?

$ionicApp breaks strict-di when required using browserify

This line breaks my app:
https://github.com/driftyco/ionic-service-core/blob/master/ionic-core.js#L135

Error: http://errors.angularjs.org/1.3.15/$injector/strictdi?p0=function(%24httpProvider)

Uncaught Error: [$injector:modulerr] Failed to instantiate module main due to:
Error: [$injector:modulerr] Failed to instantiate module main.common due to:
Error: [$injector:modulerr] Failed to instantiate module ionic.service.core due to:
Error: [$injector:strictdi] function($httpProvider) is not using explicit annotation and cannot be invoked in strict mode
http://errors.angularjs.org/1.3.15/$injector/strictdi?p0=function(%24httpProvider)
    at file:///android_asset/www/scripts/bundle.js:7162:12
    at Function.annotate (file:///android_asset/www/scripts/bundle.js:10573:17)
    at invoke (file:///android_asset/www/scripts/bundle.js:11280:36)
    at Object.instantiate (file:///android_asset/www/scripts/bundle.js:11310:27)
    at provider (file:///android_asset/www/scripts/bundle.js:11145:36)
    at Object.provider (file:///android_asset/www/scripts/bundle.js:11137:16)
    at runInvokeQueue (file:///android_asset/www/scripts/bundle.js:11208:35)
    at file:///android_asset/www/scripts/bundle.js:11216:11
    at forEach (file:///android_asset/www/scripts/bundle.js:7422:20)
    at loadModules (file:///android_asset/www/scripts/bundle.js:11198:5)
http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=ionic.service.core…s%20(file%3A%2F%2F%2Fandroid_asset%2Fwww%2Fscripts%2Fbundle.js%3A11198%3A5)
    at file:///android_asset/www/scripts/bundle.js:7162:12
    at file:///android_asset/www/scripts/bundle.js:11237:15
    at forEach (file:///android_asset/www/scripts/bundle.js:7422:20)
    at loadModules (file:///android_asset/www/scripts/bundle.js:11198:5)
    at file:///android_asset/www/scripts/bundle.js:11215:40
    at forEach (file:///android_asset/www/scripts/bundle.js:7422:20)
    at loadModules (file:///android_asset/www/scripts/bundle.js:11198:5)
    at file:///android_asset/www/scripts/bundle.js:11215:40
    at forEach (file:///android_asset/www/scripts/bundle.js:7422:20)
    at loadModules (file:///android_asset/www/scripts/bundle.js:11198:5)
http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=main.common&p1=Err…s%20(file%3A%2F%2F%2Fandroid_asset%2Fwww%2Fscripts%2Fbundle.js%3A11198%3A5)
    at file:///android_asset/www/scripts/bundle.js:7162:12
    at file:///android_asset/www/scripts/bundle.js:11237:15
    at forEach (file:///android_asset/www/scripts/bundle.js:7422:20)
    at loadModules (file:///android_asset/www/scripts/bundle.js:11198:5)
    at file:///android_asset/www/scripts/bundle.js:11215:40
    at forEach (file:///android_asset/www/scripts/bundle.js:7422:20)
    at loadModules (file:///android_asset/www/scripts/bundle.js:11198:5)
    at createInjector (file:///android_asset/www/scripts/bundle.js:11124:11)
    at doBootstrap (file:///android_asset/www/scripts/bundle.js:8551:20)
    at bootstrap (file:///android_asset/www/scripts/bundle.js:8572:12)
http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=main&p1=Error%3A%2…p%20(file%3A%2F%2F%2Fandroid_asset%2Fwww%2Fscripts%2Fbundle.js%3A8572%3A12)

CORE: Unable to load app ID or API key, falling back to $ionicApp.getApp()

Hi, all,
I'm working on ionic push, and added ionic-service-core. but I get this warning all the time.

Maybe I set the appID and API key at wrong place?

I did something like this:

.config([ '$ionicAppProvider', function($ionicAppProvider) {
  $ionicAppProvider.identify({
    app_id : 'XXXXXX',
    api_key : 'XXXXXXXXXXXXXX'
  });
} ]);

also I did in .io-config.json

{"app_id":"XXXXXX","api_key":"XXXXXXXXXXXXXX"}

Any ideas???

firebase authWithPassword callback is not firing when ionic-service-core is included

The problem occurs on my Android 4.4 device. In the browser it is working fine. The response of the request can be viewed in the chrome dev tools network tab, but the callback is not firing.

FirebaseAuth.$authWithPassword(user).then(function(authData) { console.log(authData); }).catch(function(error) { console.log(error); });

I am using
"ionic": "ionic-team/ionic-bower#1.0.1",
"ionic-service-core": "0.1.10",
"firebase": "2.2.9",
"angularfire": "1.1.2"

bug: $ionicUser.identify problem.

From @tigrus on July 21, 2015 10:55

Type: bug

Platform: desktop browser

Doing:

    $ionicUser.identify({ 
        'user_id':$ionicUser.generateUUID(); 
    })

Getting 403 error:

   {"detail":"CSRF Failed: CSRF token missing or incorrect."}

After setting CSRF from cookies to header X-CSRFToken getting 405 error:

   {"detail":"Method \"POST\" not allowed."}
```</span>

<span is-issue-template></span>


_Copied from original issue: driftyco/ionic#4117_

Automatic User properties should be prefixed and documented

All properties set by default by Ionic on the User object should be both documented and prefixed. So for example, the system ID (used by Analytics) is set to _id. But there are multiple properties like device, is_on_device, and image, that should probably be renamed to something like _device, or perhaps

ionicMeta.device

The idea being to ensure my app doesn't accidentally conflict with something Ionic sets by default.

And of course - all these keys should be documented as to their purpose.

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.