Some fields of userinfo return empty Wechat API - wechat

I use WeChat API to get user info, but some fields are empty ("nickname" is empty). This API has worked before 12/05/2022 but it's failed now. I don't know why we cannot get these values. Please help me take a look at this. Thank you so much.
https://developers.weixin.qq.com/doc/offiaccount/en/User_Management/Get_users_basic_information_UnionID.html#UinonId
Link image

According to the WeChat official description, this method will no longer output avatar and nickname information after 12/27/2021.

Using button component with "open-type"="getUserInfo".And then you will get userInfo in "bindgetuserinfo" function.
<button bindgetuserinfo="handleGetUserInfo" open-type="getUserInfo">getUserInfo</button>
new Page({
handleGetUserInfo(e){
console.log(e)
//...some code
}
})

Related

Understand Dynamic Links Firebase

I would like to understand better Firebase Dynamic Links because i am very new to this subject.
What i would like to know :
FirebaseDynamicLinks.instance.getInitialLink() is supposed to return "only" the last dynamic link created with the "initial" url (before it was shorten) ?
Or why FirebaseDynamicLinks.instance.getInitialLink() doesn't take a String url as a parameter ?
FirebaseDynamicLinks.instance.getDynamicLink(String url) doesn't read custom parameters if the url was shorten, so how can we retrieve custom parameters from a shorten link ?
My use case is quite simple, i am trying to share an object through messages in my application, so i want to save the dynamic link in my database and be able to read it to run a query according to specific parameters.
FirebaseDynamicLinks.instance.getInitialLink() returns the link that opened the app and if the app was not opened by a dynamic link, then it will return null.
Future<PendingDynamicLinkData?> getInitialLink()
Attempts to retrieve the dynamic link which launched the app.
This method always returns a Future. That Future completes to null if
there is no pending dynamic link or any call to this method after the
the first attempt.
https://pub.dev/documentation/firebase_dynamic_links/latest/firebase_dynamic_links/FirebaseDynamicLinks/getInitialLink.html
FirebaseDynamicLinks.instance.getInitialLink() does not accept a string url as parameter because it is just meant to return the link that opened the app.
Looks like there's no straightforward answer to getting the query parameters back from a shortened link. Take a look at this discussion to see if any of the workarounds fit your use case.

Firebase Analytics Events - currentScreen is always screen_view

On my way implementing firebase analytics into my flutter app, i cant get the proper events to trigger or i dont get how this should work. Lets take the following code:
firebaseAnalytics.setCurrentScreen(screenName: "Dashboard");
When i trigger this event, in the Firebase Analytics debug view i see this:
The same when i trigger the screen changes automatically via:
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: appState.firebaseAnalytics),
],
So my question is: Why does Analytics prints out "screen_view" instead of "Dashboard" or any other name i have in my named routes ??
The screen name is in fact submitted to the inner workings of the API cause i debugged firebase_analytics.dart on that place:
Future<void> setCurrentScreen(
{#required String screenName,
String screenClassOverride = 'Flutter'}) async {
if (screenName == null) {
throw ArgumentError.notNull('screenName');
}
await _channel.invokeMethod<void>('setCurrentScreen', <String, String>{
'screenName': screenName,
'screenClassOverride': screenClassOverride,
});
}
Answering my own question and thus wasting the bounty is hard but thats the way it is. Here are my findings:
The user provided screenName in the API gets submitted to the Firebase Analytics Dashboard but you need to drill down on the event "screen_view" to see the actual clicked screen Names you supplied. Unfortunately the user supplied Name wont be shown in the debugView of the Firebase Analytics console which got me on the wrong trail in the first place, thinking that its missing altogether, which is wrong.
tl;dr: screenName is just a parameter of screen_view Event and its right inside the screen_view event which you can drill down on.
Why route names don't show in the DebugView by using navigatorObservers? Looking for an explanation to this issue I got here and found the answer in Marc's Answer. It is actually being collected and is located as a parameter called firebase_screen.🧐

Get Username of Current Realm SyncUser in Swift

Realm Swift 2.0.2, Swift 3
I'd like to display the username of the current Realm SyncUser in my UI. I know I can get the unique ID of a user like this:
let user = SyncUser.all().first
print(user?.identity) //a7f84g203fd18... etc.
...but is there a way to get the user's username? I don't see anything in the docs about it.
Currently there is no way to get username from SyncUser: SyncUser doesn't have username at all, it's just one of the credentials that could be used for authentication.
There is also a related issue at https://github.com/realm/realm-mobile-platform/issues/12
My current solution is to save to UserDefaults the user's email/username when they sign up:
let defaults = UserDefaults.standard
defaults.set(self.email.text!, forKey: "userEmail")
...and then reference it later where I need it in my app:
//Show username/email
accountStatus.text = defaults.string(forKey: "userEmail")

Google Form email notification

I'm looking to have the information submitted on a google form to be on the email notification that I receive. I have tried several things but I can't seem to get it to work. Any ideas?
Create a new form in Google Docs, if you haven’t done that yet, add the necessary fields to the form and save your changes. Now go back to Google Docs and open the spreadsheet corresponding to that particular form.
Choose Tools > Notification rules... and select the option that says Notify me when... A user submits a form. You can also set how frequently you would like to be notified – right away or with daily digest.
Reference: https://support.google.com/docs/answer/91588
To get the notification in your email, you can refer to the this Google add-on.
Also to enable the data or responses to appear in notification you have to enter a script in the form. which basically tries to extract the columns from the spreadsheet. Sample:
var p = SpreadsheetApp.getActiveSheet();
var column = p.getRange(1,1,1,s.getLastColumn()).getValues()[0];
I hope you build the script by yourself!

Meteor.users maintaining users

I have a Meteor app where I need to:
Create / update app users including their name, username and password. So I was wondering if first is it possible to do so while login to the app as a Meteor user? In other words is it possible to create / update other app users while logging in as an app user? I've tried to search for an example / how to but couldn't find any so any help will be highly appreciated.
Add custom fields to Meteor.users document (ex. User type(accountant / sales...etc), Phone...etc)? After research couldn't find any example except on how to update Meteor.users profile in update only, but couldn't find how to do so when creating the new user, so any help will be highly appreciated.
Thanks
To add fields to user simply use onCreateUser function
Accounts.onCreateUser(function(user) {
user.type = "customer";
user.phone = "123456789";
//etc
return user;
});
And I didn't understand first question, but you can update user data by making query, such as:
Meteor.users.update({_id:this._id},{$addToSet~});

Resources