Cloudkibo / Kibo_Client_iOS

0 stars 0 forks source link

Integrate Azure Push Notifications #16

Closed sumairasaeed closed 8 years ago

sumairasaeed commented 8 years ago

We would integrate the Azure push notifications here so that mobile device is able to receive push notifications from server. It would also then call the REST API to fetch the chat message.

sumairasaeed commented 8 years ago

Working on this. There is error in embedding Azure Notifications SDK. App is unable to find Notifications module.

sumairasaeed commented 8 years ago

Spent lot of time on this to try to integrate Azure sdk. This issue is still not resolved. I tried adding it into our SDK and it was giving build errors. Then I worked more to integrate it into Host Application and it failed there as well.

sumairasaeed commented 8 years ago

Worked on this. Azure Notifications SDK has been successfully integrated. The issue was in Bridging header between Obj-C and Swift. It gets connected to Notification hub. We can close it after testing with @zarmeen92

sumairasaeed commented 8 years ago

Tested it with @zarmeen , she ran a sample code for sending test push notification. It was not received by Mobile Client. Will look into this today.

jekram commented 8 years ago

you have been working on this for 21 days. When will this get done and what is the next step?

I need a staus ASAP

sumairasaeed commented 8 years ago

Sir, there was issue of connection string of notification hub on which app was listening. I corrected it but it still didnt work. Next I am looking into if APNS certificates for push notifications are correctly used.

On Thu, Oct 6, 2016 at 7:51 PM, Cloudkibo notifications@github.com wrote:

you have been working on this for 21 days. When will this get done and what is the next step?

I need a staus ASAP

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Cloudkibo/Kibo_Client_iOS/issues/16#issuecomment-251986447, or mute the thread https://github.com/notifications/unsubscribe-auth/AKbhp16DY2dy_o-nJCpE1EcRnbc5vSBDks5qxQrWgaJpZM4J0O_Y .

jekram commented 8 years ago

@sumairasaeed There are step by step tutorials on these with sample code. Can we not follow basics. ?

We have already done this once with Kibochat.

sumairasaeed commented 8 years ago

Yes sir. Want to discuss something on this. I had followed steps of generating APP ID , APNS Certificate , Provisioning profile. Downloaded APNS certificate and uploaded it on azure portal. Notifications are not received and I will check with @sojharo today on azure portal if correct certificate is uploaded. I am pretty confident there is some issue with certificate or provisioning profile.

When working on this, one important point came into my point which I wanted to point out here sir. Currently we have a sample host application in which we integrate our SDK. Push Notifications can be integrated within application only. Application can listen to push notifications. SDK itself cannot listen it.

Currently we followed all the steps of creating APNS certificate etc. with host application. We have our one standard notification hub on azure and it has a particular hubname and connectionstring. Our kibo engage server uses same credentials to listen and send notifications.

We can only upload single APNS certificate on our notification hub. For example i uploaded APNS certificate of my "sample host application". It means only one host application can get connected to it. This is not right.

We will have to re-think on this. Our server might have to maintain details of which host application is using what hubname and what connectionstring. It will then send push notification to that hub which belong to Host App "A" for example.

Here is a link which supports this discussion point: http://stackoverflow.com/questions/27247622/azure-notification-hubs-how-to-set-multiple-apps-on-the-same-hub It clearly states that we can have single notification hub per application.

If we think of our scenario, we have to integrate our widget into some Host App "B" for example. There are chances that Host application "B" is already using push notifications within their application. Then they will just have to give us hub credentials. Our server will store those credentials and will communicate with Host App "B" using those credentials. Host App "B" will differentiate between our kiboengage push notification and its own push notification by analysing payload format and perform action accordingly.

To implement this, we will require some major changes on Kibo Engage Server where it is handling push notifications. Server will have to send push notification on respective notification hub of customer only. I think I would do some more research on this and will make a discussion document on this today. We will understand it much better then.

@sojharo FYI: I am not sure if this will be same for Android because Android does not require any app-specific certificate (e.g. APNS for iOS apps)

On Fri, Oct 7, 2016 at 4:52 AM, Cloudkibo notifications@github.com wrote:

@sumairasaeed https://github.com/sumairasaeed There are step by step tutorials on these with sample code. Can we not follow basics. ?

We have already done this once with Kibochat.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Cloudkibo/Kibo_Client_iOS/issues/16#issuecomment-252119889, or mute the thread https://github.com/notifications/unsubscribe-auth/AKbhpyMomK9oAwXLI1_VlkZjsNStmWalks5qxYmggaJpZM4J0O_Y .

jekram commented 8 years ago

@sumairasaeed @sojharo

  1. First thing first. Let's get this working. Work with Sojharo to get this resolved today.
  2. We would figure out how it will take multiple customers later and do NOT think even if we have to get separate credentials for each customer, it can be implemented via a table.

Let's just focus the current use case. We will worry about multiple customers much later.

sumairasaeed commented 8 years ago

ok sir.

On Fri, Oct 7, 2016 at 8:31 AM, Cloudkibo notifications@github.com wrote:

@sumairasaeed https://github.com/sumairasaeed @sojharo https://github.com/sojharo

1.

First thing first. Let's get this working. Work with Sojharo to get this resolved today. 2.

We would figure out how it will take multiple customers later and do NOT think even if we have to get separate credentials for each customer, it can be implemented via a table.

Let's just focus the current use case. We will worry about multiple customers much later.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Cloudkibo/Kibo_Client_iOS/issues/16#issuecomment-252145200, or mute the thread https://github.com/notifications/unsubscribe-auth/AKbhp4M9HGW184WmmpWynU0kBx6odS7Bks5qxb0BgaJpZM4J0O_Y .

sumairasaeed commented 8 years ago

This has been resolved now. Uploaded new correct certificate on portal. Also there was a bug in code on both client side and server side. These were corrected and notifications successfully integrated now.

image

jekram commented 8 years ago

@sumairasaeed @sojharo

Thanks :-)