How can I get UUID in Flutter Web.
I need some unique identifier in order to keep record of devices useb by customer,my testing device,develeper device.
In android, I'm using device_info_plugin.
How can I get Unique identifier in Web?
Thanks in Advance
You can use platform_device_id to get the browser details.
For browser info, you can use it as
import 'package:platform_device_id/platform_device_id.dart';
String? deviceId = await PlatformDeviceId.getDeviceId;
print($deviceId);
OR
hare is the Answer to the approach to set a custom uuid for flutter web
Related
i am working in flutter app,
I want each user to create only one account through his device
That is, banning the device from creating other accounts for two days
After two days, the user can create another account only, and so on,
in my case : save device id or token and date Time in firebase and before create account app check if this device was registered or not if registered check time , this way is right ?
and how can i get device id or any constant number from device ?
thanks
I'm sorry, I think I may not have fully grasped your question, here's my guess about what you are asking based on the agglomeration of English words you've put:
You are using Flutter to develop the front-end of an application while using Firebase for the back-end. You want to make sure that each device could only create one account every 48 hours. Please correct me if my understanding is wrong.
There's never a unique solution to those kind of questions, and I think your approach (timestamp + some ID that tells devices apart) is a decent one.
To get the device ID, it looks like you can use the device_info_plus plugin according to here: How to get unique device id in flutter?
You need to find and store unique device ID in the database.
You can find unique device using this plugin
dependencies:
device_info_plus: ^3.2.3
Create a method:
Future<String?> _getId() async {
var deviceInfo = DeviceInfoPlugin();
if (Platform.isIOS) { // import 'dart:io'
var iosDeviceInfo = await deviceInfo.iosInfo;
return iosDeviceInfo.identifierForVendor; // unique ID on iOS
} else if(Platform.isAndroid) {
var androidDeviceInfo = await deviceInfo.androidInfo;
return androidDeviceInfo.androidId; // unique ID on Android
}
}
I was using firebase_admob package where I could add the test devices IDs with:
var targetingInfo = MobileAdTargetingInfo(
testDevices: <String> [...]
);
But with google_mobile_ads I couldn't find anything similar to that. So, where can I put the test device IDs? Am I only left with using the test Ad unit?
Use updateRequestConfiguration callback on the MobileAds instance, and provide test device IDs.
MobileAds.instance
..initialize()
..updateRequestConfiguration(RequestConfiguration(
testDeviceIds: <String>[],
));
Im using Agora SDK along with Flutter for a project,
I have gone through the SDK Documentation but could not make out the requirement im currently having,
Lets say there is a channel with 100 Users
and User modal is like
User{
String name;
String imageUrl;
}
I would like to update the ui for all 100 user by displaying the image of the current user who is speaking in the channel
The best way to do that would be to add uid in your user modal and then use the activeSpeaker callback provided in the SDK,
activeSpeaker callback returns the uid of the user who is speaking currently and you can use that uid to display the user video or in your case the image of that user.
Have a look at the documentation over here:activeSpeaker documentation
I want to know when using firebase_admob, do I need this code?
If so, when releasing an app, what should I write for keywords, contentUrl, and testDevices?
I mean, when releasing an app, testDevices is even necessary?
MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
keywords: <String>['flutterio', 'beautiful apps'],
contentUrl: 'https://flutter.io',
birthday: DateTime.now(),
childDirected: false,
designedForFamilies: false,
gender: MobileAdGender.male, // or MobileAdGender.female, MobileAdGender.unknown
testDevices: <String>[], // Android emulators are considered test devices
);
this information is used to show ad to users.
You should use keywords related to your application. Ex: if Your application is related to hospital then you can use medicine as your key words.
you can add you web site url if you develop any web site for particular application as contentUrl .
testDevices is a Id of you device in which you are tested. if you want to test your application in real device then you must add test device id because it help you to avoid ad mob bane.
MobileAdTargetingInfo class properties mirror the native AdRequest API.
You will find more information about those properties in the documentation for AdRequest.Builder and RequestConfiguration.Builder.
AdRequest.Builder
public AdRequest.Builder addKeyword (String keyword)
Add a keyword for targeting purposes.
public AdRequest.Builder setContentUrl (String contentUrl)
Sets the content URL for a web site whose content matches the app's primary content. This web site content is used for targeting and brand safety purposes.
At the time of writing some parameters from the question have been deprecated with no alternative, some like the one below replaced with a different approach, while some other moved to RequestConfiguration.Builder.
public AdRequest.Builder setIsDesignedForFamilies (boolean isDesignedForFamilies)
Deprecated. Use Ad Content Filtering.
RequestConfiguration.Builder
public RequestConfiguration.Builder setTagForChildDirectedTreatment (int tagForChildDirectedTreatment)
This method allows you to specify whether you would like your app to be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA)
public RequestConfiguration.Builder setTestDeviceIds (List testDeviceIds)
Sets a list of test device IDs corresponding to test devices which will always request test ads. The test device ID for the current device is logged in logcat when the first ad request is made.
If I have an application ID for an app on the iOS App Store, how can I find the package name?
For example, if I know the application ID is 457446957, how can I find out what app this is (Jetpack Joyride, in this case):
https://itunes.apple.com/us/app/jetpack-joyride/id457446957?mt=8&isWebExpV2=true&dataOnly=true
Return all information about application(include package name)
https://itunes.apple.com/lookup?id=
You don't actually need the package name to load an App Store page, just the ID. So for your above example, if you load:
https://itunes.apple.com/us/app/id457446957
you'll get the App Store page for that app and could grab the package name using web-scraping. In this example,
h1.product-header__title product-header__title--app-header
contains the text:
Jetpack Joyride