{"action":"created","issue":{"url":"https://api.github.com/repos/sclausen/ngx-mqtt/issues/98","repository_url":"https://api.github.com/repos/sclausen/ngx-mqtt","labels_url":"https://api.github.com/repos/sclausen/ngx-mqtt/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/sclausen/ngx-mqtt/issues/98/comments","events_url":"https://api.github.com/repos/sclausen/ngx-mqtt/issues/98/events","html_url":"https://github.com/sclausen/ngx-mqtt/issues/98","id":335737517,"node_id":"MDU6SXNzdWUzMzU3Mzc1MTc=","number":98,"title":"Cannot integrate with Ionic3","user":{"login":"praseedm","id":13822610,"node_id":"MDQ6VXNlcjEzODIyNjEw","avatar_url":"https://avatars2.githubusercontent.com/u/13822610?v=4","gravatar_id":"","url":"https://api.github.com/users/praseedm","html_url":"https://github.com/praseedm","followers_url":"https://api.github.com/users/praseedm/followers","following_url":"https://api.github.com/users/praseedm/following{/other_user}","gists_url":"https://api.github.com/users/praseedm/gists{/gist_id}","starred_url":"https://api.github.com/users/praseedm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praseedm/subscriptions","organizations_url":"https://api.github.com/users/praseedm/orgs","repos_url":"https://api.github.com/users/praseedm/repos","events_url":"https://api.github.com/users/praseedm/events{/privacy}","received_events_url":"https://api.github.com/users/praseedm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-06-26T09:38:43Z","updated_at":"2018-06-29T10:53:23Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPLEASE PROVIDE THE FOLLOWING INFORMATION.\r\n\r\nISSUESNOT FOLLOWING THE ISSUE TEMPLATE WILL BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n- [ x] **I have searched for similar issues in this repository, but couldn't find one.**\r\n- [ ] **I have read the README and have a basic understanding how angular works.**\r\n## I'm submitting a...\r\n<!-- Check one of the following options with \"x\" -->\r\n- [x ] Regression (a behavior that used to work and stopped working in a new release)\r\n- [ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->\r\n- [ ] Feature request\r\n\r\n## Current behavior\r\n<!-- Describe how the issue manifests. -->\r\nsubscription to topic not updating data.\r\n\r\n## Expected behavior\r\n<!-- Describe what the desired behavior would be. -->\r\n\r\n\r\n## Minimal reproduction of the problem with instructions\r\n<!--\r\nFor bug reports please provide a *MINIMAL DEMO* of the problem at https://codesandbox.io or https://stackblitz.com/ or a separated github repository.\r\n-->\r\nUsing ionic 3 with ngx-mqtt@5.4.0 , subscription to topic is not working. Please help me to integrate mqtt with ionic . \r\nIs ngx-mqtt version or angular versions iam using causing this error?.\r\n\r\nionic info\r\n\r\ncli packages: (/home/web/.nvm/versions/node/v8.11.2/lib/node_modules)\r\n\r\n    @ionic/cli-utils  : 1.19.2\r\n    ionic (Ionic CLI) : 3.20.0\r\n\r\nglobal packages:\r\n\r\n    cordova (Cordova CLI) : 8.0.0\r\n\r\nlocal packages:\r\n\r\n    @ionic/app-scripts : 3.1.10\r\n    Cordova Platforms  : none\r\n    Ionic Framework    : ionic-angular 3.9.2\r\n\r\nSystem:\r\n\r\n    Android SDK Tools : 26.1.1\r\n    Node              : v8.11.2\r\n    npm               : 5.6.0\r\n    OS                : Linux 4.4\r\n\r\nEnvironment Variables:\r\n\r\n    ANDROID_HOME : /home/web/Android/Sdk\r\n\r\nMisc:\r\n\r\n    backend : pro\r\n\r\n## What is the motivation / use case for changing the behavior?\r\n<!-- Describe the motivation or the concrete use case. -->\r\n\r\n\r\n## Environment\r\n\r\n- Broker <!-- Hummingbird, HiveMQ, Mosquitto, etc. -->\r\ncloudmqtt.com.\r\n\r\nOthers:\r\n<!-- Anything else relevant? -->\r\nwhen i use ngx-mqtt latest version it throws built error.\r\n![ngx_error](https://user-images.githubusercontent.com/13822610/41902975-567b8912-7952-11e8-833e-ee3d1c5f0ddc.png)\r\n\r\nusing ngx-mqtt@5.4.0\r\n- app.module.ts -\r\n``` typescript\r\nimport { MqttModule, MqttService , IMqttServiceOptions} from 'ngx-mqtt';\r\n\r\nexport const MQTT_SERVICE_OPTIONS = {\r\n  hostname: 'm10.cloudmqtt.com',\r\n  port: 34256,\r\n  rotocol: 'ws',\r\n  path: '/'\r\n};\r\n\r\nexport function mqttServiceFactory() {\r\n  return new MqttService(MQTT_SERVICE_OPTIONS);\r\n}\r\n\r\n@NgModule({\r\n  declarations: [\r\n    MyApp,\r\n    HomePage\r\n  ],\r\n\r\n  imports: [\r\n    BrowserModule,\r\n    IonicModule.forRoot(MyApp),\r\n    MqttModule.forRoot({\r\n      provide: MqttService,\r\n      useFactory: mqttServiceFactory\r\n    })\r\n  ],\r\n```\r\n- home.ts - \r\n``` typescript\r\nimport {MqttService, IMqttMessage} from 'ngx-mqtt';\r\nimport { Observable, Subscription } from 'rxjs'\r\n\r\n@Component({\r\n  selector: 'page-home',\r\n  templateUrl: 'home.html'\r\n})\r\nexport class HomePage implements OnDestroy {\r\n  message : string = \"def\";\r\n  private subs : Subscription;\r\n\r\n  constructor(public navCtrl: NavController,\r\n    private mqttService: MqttService) {\r\n\r\n    this.subs = this.mqttService.observe('first').subscribe(\r\n      (message : IMqttMessage) => {\r\n        console.log(message);\r\n        this.message = message.payload.toString();\r\n      }\r\n    );\r\n\r\n  }\r\n\r\n  public ngOnDestroy() {\r\n    this.subs.unsubscribe();\r\n  }\r\n\r\n}\r\n```\r\nPlease help me to integrate ngx-mqtt with ionic.\r\n\r\n[EDIT BY @sclausen] In the future, please properly format your issue.\r\n"},"comment":{"url":"https://api.github.com/repos/sclausen/ngx-mqtt/issues/comments/401320578","html_url":"https://github.com/sclausen/ngx-mqtt/issues/98#issuecomment-401320578","issue_url":"https://api.github.com/repos/sclausen/ngx-mqtt/issues/98","id":401320578,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTMyMDU3OA==","user":{"login":"praseedm","id":13822610,"node_id":"MDQ6VXNlcjEzODIyNjEw","avatar_url":"https://avatars2.githubusercontent.com/u/13822610?v=4","gravatar_id":"","url":"https://api.github.com/users/praseedm","html_url":"https://github.com/praseedm","followers_url":"https://api.github.com/users/praseedm/followers","following_url":"https://api.github.com/users/praseedm/following{/other_user}","gists_url":"https://api.github.com/users/praseedm/gists{/gist_id}","starred_url":"https://api.github.com/users/praseedm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praseedm/subscriptions","organizations_url":"https://api.github.com/users/praseedm/orgs","repos_url":"https://api.github.com/users/praseedm/repos","events_url":"https://api.github.com/users/praseedm/events{/privacy}","received_events_url":"https://api.github.com/users/praseedm/received_events","type":"User","site_admin":false},"created_at":"2018-06-29T10:53:23Z","updated_at":"2018-06-29T10:53:23Z","author_association":"NONE","body":"ngx-mqtt@5.4.0 working well . Issue resolved.\r\nThank you "}}
{"actor":{"display_login":"praseedm"}}