Integrating pubnub in Ionic 2
You are aware of Ionic 2 framework and already setup the app. If not, please follow Installing Ionic to setup your environment.
You already setup pubnub on server side and publishing the events on particular channel.
The first step is to add the pubnub into your html file. You can either include a cdn or copy the script locally and add it to your html. I will be including the following cdn in my head tag.
The next step is to download a pubnub.ts SDK:
In the above code, if you look into the connectionuuid(uuid) I am calling the server to get the subscription key (You can hard code the subscription key for security reasons I am getting from server)). Once I got the subscription key I am initializing pubnub and setting isReady to true. Whoever what to listen to any channel, they can do so by calling listen method of pubnub service.



Nice! Thanks for the tips!
vcxvcv
Hi, I have followed your tutorials, but didnt understand how you are creating channels in one to one chat? I am struggling to get the idea of creating channels in the case of one to one chat. Could you please help me with it?
https://www.pubnub.com/docs/web-javascript/pubnub-javascript-sdk
please follow this link...
This comment has been removed by the author.
Do you ever think of about the credit card which you get many offers to your profile
capitol one.com