Subscriptions not receiving timeline notification

2019-08-16 07:25发布

问题:

I'm encountering the same problem described on this question - Subscriptions Not Receiving Timeline Notifications.

The last time my app received a timeline notification was on 11/13.

Here's what I did:

  1. Created my project using the ASP.NET Quick Start

  2. Deployed the project to a public facing web server, with HTTPS (https://www.bsudevtech.myhosting.me)

  3. When users authenticate on the web site, a timeline subscription is created - I have verified this by adding checkpoints throughout the app that insert a record into a backend SQL Server. I have also verified this using Jenny's comment on the original post - I can see the timeline subscription for my app, for my Google Account ID and the correct URL for notification posts.

  4. From my Android app, I'm able to successfully create sharing contacts

  5. From Glass, I can take a photo and share with one of those contacts

  6. The photo is duplicated on the timeline

  7. The photo never comes through the notification controller on the ASP.NET app and I do not see any hits to the controller in the IIS logs

I can send timeline items from my Android app and they appear on Glass, I just cannot get the "share photo" to work properly. When creating my share contact, here's what I used:

ID = unique ID for the contact

Display name

Image URL

Accept Types = image/jpeg and image/png

Sharing Features = "ADD_CAPTION"

I've added logging to the notification controller as well and none of the logging ever appears in my backend database, so coupled with the fact the page doesn't appear in the logs, it's not being called after the photo is shared with the sharing contact on Glass.

From the Playground, I can see the duplicate timeline item:

{
  "kind": "mirror#timelineItem",
  "id": "5ef229b1-708e-4a3a-a7c0-8a9451fc47ce",
  "created": "2013-11-20T18:19:05.865Z",
  "updated": "2013-11-20T18:19:08.984Z",
  "displayTime": "2013-11-20T18:19:05.865Z",
  "etag": "1384971548984",
  "recipients": [
    {
      "kind": "mirror#contact",
      "source": "api:143178395015",
      "id": "28f773ad-bb35-4ffa-b07c-c2997a208528",
      "displayName": "Educause",
      "imageUrls": [
        "https://apps.bsu.edu/androidservicehandler/images/traveler/glass_contact.png"
      ],
      "priority": 1
    }
  ],
  "attachments": [
    {
      "id": "ps:5948400824138489778",
      "contentType": "image/jpeg"
    }
  ],
  "menuItems": [
    {
      "action": "DELETE"
    }
  ]
}

Any suggestions beyond those on the original post are welcomed!

回答1:

In a continued effort to debug and figure out this problem, I may have found a resolution - that or there was something going on with the backend communication between the Google Mirror API and my web app. Regardless, I am now receiving "share" notifications.

In general, my Glassware serves as a companion to an existing Android app. Other than subscribing to timeline notifications (which is handled via the HTTPS web app), all functionality is handled via the app - inserting/deleting contacts and other timeline cards.

  1. Removed my Glassware and all permissions via the My Glass web site
  2. Waited 5-10 minutes and visited the sign-in page for my Glassware and re-authenticated
  3. Refreshed the My Glass web site to confirm the Glassware was listed with others like Facebook, Evernote, etc.
  4. In the Android app, I signed out and signed back in to generate the new auth token for my app and the Glassware
  5. In the Android app, I deleted all existing "share contacts" I had created
  6. Rebooted Glass
  7. Confirmed that all share contacts were removed (attempted to Share a photo and verified only G+ circles and Facebook groups appeared)
  8. In the Android app, I recreated the share contact
  9. On Glass, I took a photo, selected Share and picked the contact I just created
  10. Within seconds, the timeline notification arrived and the card was updated, and checking my backend database confirmed that the photo arrived via the notification controller

Again, I cannot, with 100% certainty, confirm that this process resolved the issue, but I did not make any code changes in either the Android app or the Glassware notification handler and I have been trying to get this to work for 2 days.