Following is how I'm creating dynamic link
//Buiid dynamic link
DynamicLink dynamicLink = FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLink(Uri.parse("https://www.chefcookrecipe.com/"))
.setDynamicLinkDomain("chefcookrecipe.page.link")
// Open links with this app on Android
.setAndroidParameters(new DynamicLink.AndroidParameters.Builder().build())
.buildDynamicLink();
String dynamicLongUri = dynamicLink.getUri().toString();
Toast.makeText(Edit_Recipes.this, dynamicLongUri, Toast.LENGTH_SHORT).show();
The same url:"https://www.chefcookrecipe.com/" is what I set as Deep link URL in firebase, and https://chefcook.page.link is my domain in firebase.
I'm getting the long link correctly. However, when I tried to generate short link with the following code
shortLinkTask.addOnCompleteListener(this, new OnCompleteListener<ShortDynamicLink>() {
#Override
public void onComplete(#NonNull Task<ShortDynamicLink> task) {
if (task.isSuccessful()) {
// Short link created
shortLink = task.getResult().getShortLink().toString();
Uri flowchartLink = task.getResult().getPreviewLink();
Toast.makeText(Edit_Recipes.this, shortLink, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(Edit_Recipes.this, "null", Toast.LENGTH_SHORT).show();
}
}
});
I always get null. Please help I don't know what I'm missing.
I ran into same error couple of months ago. I spent all day finding what was wrong.
As long as it is reaching the conditional (if-else) statement, Your code is completely correct and nothing wrong at all.
Solution
It is usually a typographical error.
Calm yourself.
Make sure that both Deep link URL and Domain name are the same.(This is where the error usually lies). Do a copy and paste instead of typing.
I saw this issue, Don't use emulator, use real device.
Related
all right?
I'm banging my head with something that might be simple, but I can't think of anything else.
I want to make it so that when the user opens my app's map screen, the map camera will focus on where the user is located in real time.
PS: I'm using Xamarin.Essentials
Ps2: With this code the camera stays at Rome city or moves to ocean, but i need that moves to my atual position.
Below is the code I'm using, any help is welcome.
public async void AproximaLocalUsuario()
{
try
{
var request = new GeolocationRequest(GeolocationAccuracy.Medium);
var location = await Geolocation.GetLocationAsync(request);
if (location != null)
{
Position position = new Position(location.Latitude, location.Longitude);
MapSpan mapSpan = MapSpan.FromCenterAndRadius(position, Distance.FromKilometers(0.444));
map.MoveToRegion(mapSpan);
}
}
catch (FeatureNotSupportedException fnsEx)
{
// Handle not supported on device exception
}
I managed to get it to work, I wasn't starting the function, that was the problem. Below is the code that is working for me. Thanks for your help and I hope this post helps more people.
Our Google domain has groups (synced copies of our Active Directory email listservs/distribution groups) that have a lot of external accounts (currently kept as contacts in Active Directory).
As part of an intranet site I'm building I'm trying to be able to do mass search and replace of individual contact email address when for example a school district changes its domain name. One of the visual/verification steps I'm working on is to list the Google group membership of any selected external account, but I'm getting mixed results. For some accounts it seems to list the groups properly, and for others it doesn't seem to pull any. I have verified the external account's group membership in both Active Directory and in Google Admin group management, but when I query Google via code I don't get valid results every time... What am I missing? Code below.
-- in Global.asax
public static List<string> GOOGLE_GetListOfUsersGroups(string useremail)
{
List<string> groupList = new List<string>();
try
{
///stripped out credential/service stuff...
var groups = service.Groups.List();
groups.UserKey = useremail;
Groups gs = groups.Execute();
if (gs != null)
{
foreach (Google.Apis.Admin.Directory.directory_v1.Data.Group g in gs.GroupsValue)
groupList.Add(g.Email);
}
}
catch (Exception ex)
{
SendERROREmail("GLOBAL<HR>GOOGLE_GetListOfUsersGroups()<HR>useremail:" + useremail + "<HR>" + ex.ToString());
}
return groupList;
}
and the consuming function:
--- in Page.aspx
protected void ddlADExternalContacts_SelectedIndexChanged(object sender, EventArgs e)
{
lbContactsGoogleGroups.Items.Clear();
if (ddlADExternalContacts.SelectedIndex > 0)
{
//show what google has for same group
List<string> memberList = Global.GOOGLE_GetListOfUsersGroups(ddlADExternalContacts.SelectedValue);
if (memberList != null)
{
foreach (string s in memberList)
lbContactsGoogleGroups.Items.Add(new ListItem(s, s));
}
}
}
Also, does anyone have a good example how to handle this in Google's 'preferred' JSON format rather then the API route?
UPDATE: Ok, its not my code, its something with the group/Google. When I use the 'try it' functionality on the sdk admin site I get the same results for groups that work (in my code and their site) and no results from the same groups that should be showing results...
{
"kind": "admin#directory#groups",
"etag": "\"HKdfSgTnCxrWl3RtRnlZSCPY3NjdWJxz53nrhwSz7ob4/oMWMqbsluP5m2PCo8Y7WmWeHGP4\""
}
Not that that helps me any, as there's no error or anything, just the 'no groups' result as if it can't find the external account...
UPDATE2: Ok, based on what I'm seeing after some testing, I have a sneaky suspicion that Google is doing some validation of emails before checking for group membership and reporting anything. I.E. if the email being searched for is no longer valid (client's server doesn't responds that the account is reachable/enabled/exists...), it won't bother going any further... will try it out with a few more email addresses that I know should be invalid and update....later.
It looks like what you are experiencing might be a bug.
This has been reported on Google Issue Tracker here.
What you can do in this situation is to star the issue above and eventually add a comment saying that you are affected by it.
I wanted to try the Resize-Firebase-Extension. Configuration seemed very easy and pictures i upload to that bucket are being handled. The new /thumbs folder appeared and telling by the given size a much smaller version of these images is displayed in the console. However these pics cant be opened (firebase console seems to crash: a new tab opens and redirects to project overview). Also the preview is not showing in console when in the thumbs folder.
I did add the content metadata like this:
if (byteArray != null){
StorageMetadata metadata = new StorageMetadata.Builder()
.setContentType("image/jpeg")
.setCustomMetadata("isGroupImage", isGroup)
.setCustomMetadata("areaNumber", userNumber)
.build();
mUploadtask =mStorageRef.putBytes(byteArray, metadata).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
#Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
callback.onSuccess(mStorageRef.toString());
Anything else to be taken care of for the function to work? Anyone else facing that problem?
Is there another solutions rather than pass the returnUrl parameter. For example, retrieve the file directly in my server.
I have an iframe in a popup with the signature process. When I click on "Completed", the program launch my return url on iframe. But, I don't want that. I would prefer to close the popup and so to detect that the button "Completed" was clicked and the URL changed.
I have this code for detecting location change but got this error : "Origin cross platform".
window.FinishSignatureProcess = function (event, e)
{
try {
var source = e.contentWindow.location.hash; //Line problem
}
catch (e) {
//Exception
}
}
You can use the Docusign GetEnvelopeDocument API to retrieve the bytes of the document
I found a solution for my problem.
I simply redirected to a page indicating that it's finished and it's up to the user to close the popin.
Here's the code that I am using:
public async Task<IHttpActionResult> NewTopicTests([FromBody] NewTopicTestsDTO testSpec)
{
var sql = #"dbo.sp_new_topic_tests #Chunk";
SqlParameter[] parameters = new SqlParameter[]
{
new SqlParameter("#Chunk", testSpec.Chunk)
};
int result = db.Database.ExecuteSqlCommand(sql, parameters);
await db.SaveChangesAsync();
return Ok();
}
Can someone confirm if this is the correct way to do this using async? In particular do I need to do this:
int result = db.Database.ExecuteSqlCommand(sql, parameters);
await db.SaveChangesAsync();
Note that the code works however I am having a problem with my application where it suddenly stops without any error message. I am looking into every possible problem.
What's being saved here ? I think there is no need to call save changes here.
Remove save changes and you will see the same behavior, because any changes you've made in your stored procedure, are not tracked by entity framework context.
And you can rewrite your code as following:
int result = await db.Database.ExecuteSqlCommandAsync(sql, parameters);
Have you checked every where to find the reason of your problem ? Windows Error Log etc ?
Go to Debug menu of Visual Studio IDE, and open Exceptions, then check both 'throw' and 'user_unhandled' for 'Common Language Runtime Exceptions' and test your code again.