Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Vuejs Support #214

Open
lukepolo opened this issue Apr 21, 2018 · 3 comments
Open

Vuejs Support #214

lukepolo opened this issue Apr 21, 2018 · 3 comments

Comments

@lukepolo
Copy link

Which platform(s) does your issue occur on?

IOS
11.3

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it)
    tns|master⚡ ⇒ tns --version
    4.0.0

  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)

  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)
    "version": "4.0.1"

  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

    "dependencies": {
    "nativescript-push-notifications": "^1.1.3",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-vue": "^1.3.1",
    "tns-core-modules": "~3.4.1"
    },
    "devDependencies": {
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "lazy": "1.0.11"
    }

Please, tell us how to recreate the issue in as much detail as possible.

Follow the docs :

Make sure the app's id is the same as registered
tns buid ios

Go to XCode, enable push :
image

Make sure *. entitlements exist with
image

Add :

var pushPlugin = require("nativescript-push-notifications");

Is there any code involved?

I am using the https://github.com/nativescript-vue/nativescript-vue template and just this plugin, nothing else has been added.


import Vue from 'nativescript-vue';

// This fails horribly
var pushPlugin = require("nativescript-push-notifications");

import router from './router';

import store from './store';

import './styles.scss';

// Uncommment the following to see NativeScript-Vue output logs
Vue.config.silent = false;

new Vue({

  router,

  store,

}).$start();



lukepolo added a commit to lukepolo/authpush-mobile that referenced this issue Apr 21, 2018
@tbozhikov
Copy link
Contributor

Hi @lukepolo, as the support for Vue in NativeScript is in experimental stage we haven't implemented such compatibility in this plugin and that is why you may get this error. If you or anyone else can help solving this one, we will be happy to receive PRs.

@nsplugins nsplugins changed the title Can't find variable: Push Vuejs Support May 18, 2018
@rebz
Copy link

rebz commented May 22, 2018

+1 Would love to have this. I don't know enough about the iOS side to properly submit a PR.

@vratojr
Copy link

vratojr commented Jul 28, 2018

Hello, @lukepolo , to go one step further you should change your require to import:

import * as pushPlugin from "nativescript-push-notifications";

I'm using the vue template as well and I succeed in registering the app and receiving notifications.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants