Comments (27)
So I think I have narrowed this down. Basically if an apns registration is created without tags, you can never add tags (even though the api tells you that you just did). Also, WHERE ARE YOUR EFFING DOCS?
from azure-sdk-for-js.
Hello all,
Thanks for your patience.
There are a few different queries here, I'll try and address them all.
- Is there a new SDK for Azure Notifications Hub?
- See #3009 (comment)
- Where are the docs for
azure-sb
package ??- Subscribe to Azure/azure-sdk-for-node#5180 on updates on reference docs for the azure-sb
- Ok, that is for reference docs. Shouldnt there be more like samples or quick starts?
- Yes, node samples seem to be missing in https://docs.microsoft.com/en-us/azure/notification-hubs/samples. Please subscribe to MicrosoftDocs/azure-docs#59478 for updates here
- Fine! What about the original problem mentioned here about updateRegistration() call messing things up
- Based on what @ankurkul has shared, this seems to be a serialization issue. We will work with the service team to see how we can fix it.
from azure-sdk-for-js.
Also there is no documentation for any or the above mentioned functions anywhere on the web!
This is the best I could find in googles cache: http://webcache.googleusercontent.com/search?q=cache:mES4PLLFqsUJ:azure.github.io/azure-sdk-for-node/azure-sb/latest/GcmService.html+&cd=1&hl=en&ct=clnk&gl=us
from azure-sdk-for-js.
Congrats on getting the docs back online in a short 3 months. Any ideas about the tag bug?
from azure-sdk-for-js.
@ankurkul - Can you take a look at this issue?
from azure-sdk-for-js.
@tony-gutierrez : Thanks for reporting the issue and apologies for delayed response. We have identified the issue as a bug in our nodejs SDK. The root cause lies in the fact that we serialize/de-serialize registration objects into XML descriptions and do not honor correct ordering during updateRegistration calls. We will be fixing it soon and update this thread.
from azure-sdk-for-js.
Thank you for opening this issue! We are routing it to the appropriate team for follow up.
from azure-sdk-for-js.
hi @qiaozha could you pls help to check if this still an issue in new js sdk?
from azure-sdk-for-js.
hi @qiaozha could you pls help to check if this still an issue in new js sdk?
Hi Catherine, I've checked the js sdk repo, but can't find the listRegistrationsByTags operation. I've also checked the swagger specs repo, and can't find the path definition in listRegistrationsByToken operation either. I think it was replaced by other operations or being deprecated.
from azure-sdk-for-js.
hi @tony-gutierrez is this issue still valid for you? as @qiaozha mentioned, the operation couldn't be found today.
from azure-sdk-for-js.
As far as I know, there is no new sdk for notification hub.
There is a new service bus sdk, but it doesn't include notification hub functionality like the old service bus sdk did.
So basically, if you use both, there's no point in trying to use the new service bus sdk because you will lose support for notification hub. It's not a good situation. That is probably why your can't find it.
from azure-sdk-for-js.
Actually, there is a independent package notificationhubs in JS SDK https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/notificationhubs/arm-notificationhubs , I searched it, the path definition in listRegistrationsByToken operation is not in there as well.
from azure-sdk-for-js.
That's just the management sdk, not the usage sdk.
from azure-sdk-for-js.
Hi @tony-gutierrez, I am interested in the same problem. Did you ended up continuing using the old azure-sdk-for-node, did you found a solution that let you use the new azure-sdk-for-js or did you ended up building your own REST client?
Hi @qiaozha, any luck finding a solution on your side? Did you guys just drop support for managing registrations to push notification services with node?
from azure-sdk-for-js.
We are still using the old SDK for both Service Bus, and Notification Hub. It has been a while since I have checked, but I don't think any progress has been made on a new notification hub SDK to complement the new service bus sdk.
from azure-sdk-for-js.
Thanks! I do not think it is a priority for the Azure team, unfortunately.
from azure-sdk-for-js.
@ramya-rao-a @xirzec Can you help confirm that Service Bus, and Notification Hub data-plane sdks haven't been moved to js sdk repo?
from azure-sdk-for-js.
@richardpark-msft are you familiar with Notification Hub?
from azure-sdk-for-js.
@qiaozha I don't see any mention of notification hub in our track 2 repo today. I went looking for the older one to see if there's a breadcrumb to trace:
(for reference, this is the SDK that I believe we're all talking about)
https://github.com/Azure/azure-sdk-for-node/blob/master/lib/services/serviceBus/lib/notificationhubservice.js
It doesn't look like we could just copy it over as it uses some libraries that we don't use in our SDK (underscore) and it looks like it's also using an older version of the service bus library and would have to be moved to the newer AMQP-based version.
@ramya-rao-a are you aware of any history for this? I'm not sure if this library has been superceded by something else, for instance.
from azure-sdk-for-js.
@richardpark-msft thanks for looking into this. The SDK you linked is the one we are currently using, specifically the APNS and GCM part in our case. We would be happy to know if there is any plan to move this into the new SDK and to cover the complete set of endpoint available in the REST API.
from azure-sdk-for-js.
Add "Client" label so that this can be properly tracked by dataplane SDK. thanks.
from azure-sdk-for-js.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @tjsomasundaram.
from azure-sdk-for-js.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @tjsomasundaram.
from azure-sdk-for-js.
Is there a new SDK for Azure Notifications Hub
An update on my previous answer for this question:
We have decided to invest time in creating a new library for Azure Notification Hub in this repository just like we did for Service Bus following the above linked guidelines instead of simply copying over the Notification Hub parts from azure-sb into a separate package. Please subscribe to #13841 for updates
Thanks for your patience everyone.
@mpodwysocki Can you help with the question on updateRegistration and listRegistrationsByToken calls here?
from azure-sdk-for-js.
@tony-gutierrez Cannot reproduce using the following code where you can add tags successfully to a registration without tags, and then add the tags at a later point. I can then print out the registrations by the given device token to see that the tags are persisted.
const APNS_REGISTRATION_ID = '<my device token>';
// Create initial registration
service.apns.createNativeRegistration(APNS_REGISTRATION_ID, null, (err, response) => {
if (err) {
console.log(err);
return;
}
console.log('Registration success');
console.log(JSON.stringify(response, null, 2));
const registration = response;
const registrationId = registration.RegistrationId;
const deviceToken = registration.DeviceToken;
const tags = ['language_en', 'country_US'];
// Add some tags
service.apns.createOrUpdateNativeRegistration(registrationId, deviceToken, tags, (e, res) => {
if (e) {
console.log(e);
return;
}
console.log('Registration update success');
console.log(JSON.stringify(res, null, 2));
// List our registrations
service.apns.listRegistrationsByToken(APNS_REGISTRATION_ID, (e, r) => {
if (e) {
console.log(e);
return;
}
console.log('Registration list success');
console.log(JSON.stringify(r, null, 2));
});
});
});
Having a valid APNS device token, I got back the following in the results which has the first instance without tags, and then the second, I'm adding tags to the existing registration. As you can see from the tags
element in the JSON response below, there are tags persisted even after calling the listRegistrationsByToken
operation.
Registration success
{
"ETag": "1",
"ExpirationTime": "9999-12-31T23:59:59.999",
"RegistrationId": "<redacted>",
"DeviceToken": "<redacted>",
"_": {
"ContentRootElement": "AppleRegistrationDescription",
"id": "<redacted>",
"title": "<redacted>",
"published": "2021-03-22T21:31:31Z",
"updated": "2021-03-22T21:31:31Z",
"link": ""
}
}
Registration update success
{
"ETag": "2",
"ExpirationTime": "9999-12-31T23:59:59.999",
"RegistrationId": "<redacted>",
"Tags": "language_en,country_US",
"DeviceToken": "<redacted>",
"_": {
"ContentRootElement": "AppleRegistrationDescription",
"id": "<redacted>",
"title": "<redacted>",
"published": "2021-03-22T21:31:31Z",
"updated": "2021-03-22T21:31:31Z",
"link": ""
}
}
Registration list success
[
{
"ETag": "2",
"ExpirationTime": "9999-12-31T23:59:59.999Z",
"RegistrationId": "<redacted>",
"Tags": "country_US,language_en",
"DeviceToken": "<redacted>",
"_": {
"ContentRootElement": "AppleRegistrationDescription",
"id": "<redacted>",
"title": "<redacted>",
"published": "2021-03-22T21:39:15Z",
"updated": "2021-03-22T21:39:15Z",
"link": ""
}
}
]
from azure-sdk-for-js.
It's been a long time, and perhaps the issue was corrected already by the guy who diagnosed it as serialization problems. The only difference I can see from your example is that we were using template registration at the time, not native. We worked around it by adding a trash tag at creation.
from azure-sdk-for-js.
Thanks for looping back @tony-gutierrez
Closing this issue as there is no further action item.
from azure-sdk-for-js.
Related Issues (20)
- Dependency package @rollup/plugin-commonjs has a new version available
- Dependency package chai-as-promised has a new version available
- Dependency package nyc has a new version available
- [appconfig][react-native] Value of a key is undefined HOT 14
- InvalidHeaderValue error thrown when acquiring a blob lease HOT 4
- wrong @TextAnalysisClient import from the @azure/ai-text-analytics package in text analytics documentation HOT 2
- Cannot find module 'node:os' in @azure/logger dependency of @azure/identity HOT 8
- @azure/storage-blob version 12.23.0, problems/bug with setPlatformSpecificData function, Cannot access member 'bun' of undefined. HOT 4
- `@azure/storage-file-share` - Missing headers in REST requests HOT 7
- AutoLockRenew keeps throwing timeout exception HOT 13
- Not clear how to narrow `BuildModelDefaultResponse | BuildModelLogicalResponse` when using `await poller.pollUntilDone()` HOT 4
- [ai-document-intelligence] Loading from an ESM module still doesn't seem to work fine. Still loads CJS HOT 2
- [EngSys] configure dependabot to ignore certain directories when opening upgrade pull requests
- outputContentFormat: 'markdown' leads to some features (keyValuePairs, queryFields) silently not working anymore.
- `DocumentAnalysisClient` and `ClassifyDocumentOptions` are inconsistent over different client SDKs HOT 1
- Vitest can't pick up environment variable TEST_MODE when targeting browser HOT 4
- [test][core-amqp] unstable request response test HOT 2
- isAvailable event is being triggered after a 30-40 second delay, in ACS Room Video Call HOT 5
- [App Configuration] AppConfigurationClient - FeatureFlag FeatureFlag configuration setting "before each" hook for "can add and get FeatureFlag" failing in nightly runs HOT 1
- [Eventhubs - Checkpointstore Blob] updates checkpoints successfully failing in nightly runs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-sdk-for-js.