Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I want to send or text a message to a specific number in WhatsApp, and in the absence of the number or the WhatsApp customization, an error appears.
use packages
Xamarin.Forms.OpenWhatsApp
my code not work
var sendwhats = FindViewById<Button>(Resource.Id.button3);
sendwhats.Click += (sender, e) => {
var phone = textinp.Text;
Intent sendIntent = new Intent("android.intent.action.MAIN");
sendIntent.SetComponent(new ComponentName("com.whatsapp", "com.whatsapp.Conversation"));
sendIntent.PutExtra("jid", PhoneNumberUtils.StripSeparators(phone) + "#s.whatsapp.net");without "+" prefix
StartActivity(sendIntent);
};
First of all, Xamarin.Forms.OpenWhatsApp this plugin is used in Xamarin.Forms project, it cannot be used in Xamarin.Android project.
Then, If you used Xamarin.Android project, you can use following code to send the message.
private void Button1_Click(object sender, System.EventArgs e)
{
string phoneNumberWithCountryCode = "88167xxxxxxx";
string message = "Hallo";
StartActivity(new Intent(Intent.ActionView,
Uri.Parse("https://api.whatsapp.com/send?phone=" + phoneNumberWithCountryCode + "&text=" + message)));
}
If the phoneNumber did not be registed or existed, whatsapp will give you a alert. I can not give you a test GIF due to private policy, you can test it by youself.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
ADDRESS=0.0.0.0
CACHE_SIZE_MB=32
CORS_ENABLED=true
CORS_ALLOWED_HEADERS=
CORS_ALLOWED_METHODS=
CORS_ALLOWED_ORIGINS=
CORS_ALLOW_CREDENTIALS=
CORS_DEBUG=true
HOST_ONLY_DOMAINS=*
HTTP_CLIENT_TIMEOUT=5s
HTTP_MAX_AGE_DURATION=720h
HTTP_USER_AGENT=''
POPULAR_SITES=bing.com,github.com,instagram.com,reddit.com
PORT=8080
SERVER_MODE=redirect
I have this docker_run file. From the Go server how to properly set up this file?
I have an example.com where the server hosted and I am trying to use this API to my example1.com.
I have this docker_run file. From the Go server how to properly set up this file?
This file has nothing to do with Go. I guess it was supposed to be read by the application and applied there.
If you have an instance of http.HandlerFunc you can warp it into a new function call in the following way:
func setCors(h http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "your origin value...")
w.Header().Set("Access-Control-Allow-Methods", "your methods...")
w.Header().Set("Access-Control-Allow-Headers", "your headers...")
w.Header().Set("Access-Control-Max-Age", "your age...")
// other settings
h(w, r)
}
}
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm using Ionic trying to use chooser plugin to chose file from phone, transform the URI to a File and send it as FormData. Nothing seems to work.
You can initialize FormData object by creating an instance from new FormData interface as given below.
const formData = new FormData()
const formData = new FormData();
formData.append('firstname', this.firstname);
formData.append('lastname', this.lastname);
formData.append('email' , this.email);
formData.append('phone' , this.phone);
formData.append('experience' , this.experience);
formData.append('userId' , this.userInfo.user.id);
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
i have this query in SQL Server
select max(win_votos), win.cdt_id, cdt_nome
from tb_ganhadores_win as win
inner join tb_candidatos_cdt as cdt on cdt.cdt_id = win.cdt_id
group by win.cdt_id,cdt_nome
<--
and i need to create a list 'AspNetMvc' page, like
public ActionResult ListWinners(int? id){
LINQ QUERY HERE
return View('that list');
}
sorry about my english
can anyone help me please?
var res= (from win in dbContext.tb_ganhadores_wins
join cdt in dbContext.tb_candidatos_cdts
on win.cdt_id equals cdt.cdt_id
select new {win,cdt})
.GroupBy(x=>new{Id=x.win.cdt_id,Nome=x.cdt.cdt_nome})
.Select(x=>new
{
Votos=x.Max(z=>z.win.win_votos),
Id=x.Key.Id,
Nome=x.Key.Nome
})
.ToList();
If you use entity framework and your model name is like this you can use some think like this:
var result = from win in tb_ganhadores_win
join cdt in tb_candidatos_cdt on cdt.cdt_id = win.cdt_id
group win by new { win.cdt_id, cdt_nome } into g
select new
{
max = g.Max(win_votos),
win.cdt_id,
cdt_nome
};
and return result.ToList();
note :
"tb_ganhadores_win"
and
"tb_candidatos_cdt"
is your models.Replace it by what you want
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am trying to connect my mysql database to my xcode project, for a simple login view where users can put in their username and password. I have the database set up already but I need to use JSON or?
<?php
// Create connection
$con=mysqli_connect("localhost","username","password","dbname");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// This SQL statement selects ALL from the table 'Locations'
$sql = "SELECT * FROM Locations";
// Check if there are results
if ($result = mysqli_query($con, $sql))
{
// If so, then create a results array and a temporary one
// to hold the data
$resultArray = array();
$tempArray = array();
// Loop through each row in the result set
while($row = $result->fetch_object())
{
// Add each row into our results array
$tempArray = $row;
array_push($resultArray, $tempArray);
}
// Finally, encode the array to JSON and output the results
echo json_encode($resultArray);
}
// Close connections
mysqli_close($con);
?>
Here is a good article on this:
[1]: http://codewithchris.com/iphone-app-connect-to-mysql-database/#parsejson Xcode JSON
I haven't spent too much time with xcode, but from what I know there is no native API/framework for connecting to a MySQL database with it (along with most other frameworks of the kind). So yes - you need to set up a website/server with a database that has a web page that generates JSON code. Then have the xcode send a web request to the server/webpage, store the JSON code in a variable, and then use whatever method xcodes have to use/manipulate the JSON data. You'll want to make sure that both the xcode and web server don't prevent one another from passing data with the appropriate security privileges.
You can pass the data to your xcode app in whatever format you want as well - JSON, CSV, or even XML. It's whatever capabilities xcode has is what you should stick with. Really you could even make up your own data format... it's your application, do what you want with it, whatever is easiest to work with in xcode.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a method that I can to push to a JSON call. The function looks like:
def my_function(name, text , id_person, id_company)
end
What I want is to get:
{"my_function":{"name":"names_value","text":"text_value ","id_person":"id_person_value","id_company":"id_company_value"}
Is there any easy way to do this?
The question is a bit unclear, but let me try with few answer possibilities
First of all this is not a JSON format
{"my_function":{"name":"names_value","text":"text_value ","id_person":"id_person_value","id_company":"id_company_value"}
There should not be double quote (") before semicolon (:)
obj = {
my_function:
{
name: "names_value",
text: "text_value",
id_person: "id_person_value",
id_company: "id_company_value"
}
}
If you want to get each of the data in that "JSON" format, you could do this
name = obj['my_function']['name'] #name_value
text = obj['my_function']['text'] #text_value
and so on...
But if you want to make a string data into JSON format, you could do this
def my_function(name_value, text_value, id_person_value, id_company_value)
{
my_function:
{
name: name_value,
text: text_value,
id_person: id_person_value,
id_company: id_company_value
}
}.to_json
end
I hope it's answering your question...