'Flutter simulator reads and writes Firestore data but physical ios device only writes. Running the app to the physical device from XCode
I'm using Google, Apple, Facebook, and email sign-in methods, and those all work. They create documents correctly. The documents show the UID as well, so they're fine, but none of the profiles read/retrieve the documents. Also, the simulator works perfectly.
I am, however, getting WebKit errors in XCode while running the app.
These are the errors: [ProcessSuspension] 0x125084120 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=33537, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit} [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}> [ProcessSuspension] 0x125084180 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Suspended Assertion' for process with PID=33537, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
No data is being returned from Firestore (I have many stream requests for data from Firestore), but I've included the user settings request.
class UserSettings extends StatefulWidget {
const UserSettings({Key? key}) : super(key: key);
static String id = 'userSettings';
@override
State<UserSettings> createState() => _UserSettingsState();
}
class _UserSettingsState extends State<UserSettings> {
late User loggedInUser;
String imageUrl = '';
bool isWaiting = true;
final Stream<QuerySnapshot> _usersStream = FirebaseFirestore.instance
.collection('users')
.where('UID', isEqualTo: FirebaseAuth.instance.currentUser?.uid)
.snapshots();
//get users => null;
@override
Widget build(BuildContext context) {
return StreamBuilder<QuerySnapshot>(
stream: _usersStream,
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
if (snapshot.hasError) {
return const Text('Something went wrong');
}
if (snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: const Text('User Settings'),
leading: const Text(''),
actions: [
ElevatedButton(
onPressed: () {
FirebaseAuth.instance.signOut();
Navigator.pushNamedAndRemoveUntil(context,'/',(_) => false);
},
child: Row(
children: const [
Icon(FontAwesomeIcons.signOutAlt, size: 20),
SizedBox(width: 7.0),
Text('Sign Out'),
],
),
),
],
),
body: ListView(
children: snapshot.data!.docs.map((DocumentSnapshot document) {
Map<String, dynamic> data =
document.data()! as Map<String, dynamic>;
final erImageCard = (data['image_url']);
final erNameCard = (data['er_name']);
final erEmailCard = (data['er_email']);
final blogNameCard = (data['blog_name']);
final blogUrlCard = (data['blog_url']);
final erInstagramCard = (data['instagram']);
final erTwitterCard = (data['twitter']);
final erFacebookCard = (data['facebook']);
final erOtherSocialCard = (data['other_social']);
final erSharesCard = (data['share_s']);
const cardHeaderName = 'er Name';
const cardHeaderEmail = 'er Email';
const cardHeadBlogName = 'Blog Name';
const cardHeadBlogUrl = 'Blog Url';
const cardHeadInstagram = 'https://instagram.com/...';
const cardHeadTwitter = 'https://twitter.com/...';
const cardHeadFacebook = 'https://facebook.com/...';
const cardHeadOtherSocial = 'Other Social Media';
const cardHeadShares = 'Share s';
return Padding(
padding: const EdgeInsets.only(top: 15.0),
child: Column(
children: <Widget>[
Column(
children: [
CircleAvatar(
/* child: MaterialButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => UserImage(
onFileChanged: (String imageUrl) {
setState(
() {
this.imageUrl = imageUrl;
},
);
},
),
),
);
},
child: const Icon(
FontAwesomeIcons.userEdit,
size: 43.0,
),
),*/
child: GestureDetector(
onTap: () async {
await ImagePicker().pickImage(source: ImageSource.gallery);
},
),
backgroundColor: Theme.of(context)
.primaryColor
.withOpacity(0.4),
foregroundImage:
NetworkImage(erImageCard),
radius: 50.0,
),
],
),
const SizedBox(height: 8.0),
Divider(
color: Theme.of(context).hintColor.withOpacity(0.5),
),
const SizedBox(height: 5.0),
SettingsListCard(
pushedcontext4:
erName(erName: erNameCard),
settingsCardHeader: cardHeaderName,
settingsCardDetail: erNameCard,
),
SettingsListCard(
pushedcontext4:
erEmail(erEmail: erEmailCard),
settingsCardHeader: cardHeaderEmail,
settingsCardDetail: erEmailCard,
),
SettingsListCard(
pushedcontext4: BlogName(blogName: blogNameCard),
settingsCardHeader: cardHeadBlogName,
settingsCardDetail: blogNameCard,
),
SettingsListCard(
pushedcontext4: BlogURL(blogUrl: blogUrlCard),
settingsCardHeader: cardHeadBlogUrl,
settingsCardDetail: blogUrlCard,
),
SettingsListCard(
pushedcontext4: erInstagram(
erInstagram: erInstagramCard),
settingsCardHeader: cardHeadInstagram,
settingsCardDetail: erInstagramCard,
),
SettingsListCard(
pushedcontext4: erTwitter(
erTwitter: erTwitterCard),
settingsCardHeader: cardHeadTwitter,
settingsCardDetail: erTwitterCard,
),
SettingsListCard(
pushedcontext4: erFacebook(
erFacebook: erFacebookCard),
settingsCardHeader: cardHeadFacebook,
settingsCardDetail: erFacebookCard,
),
SettingsListCard(
pushedcontext4:
OtherSocial(otherSocial: erOtherSocialCard),
settingsCardHeader: cardHeadOtherSocial,
settingsCardDetail: erOtherSocialCard,
),
SettingsListCard(
pushedcontext4: Shares(
shares: erSharesCard),
settingsCardHeader: cardHeadShares,
settingsCardDetail: erSharesCard
.toString()
.replaceAll('0', 'Yes')
.replaceAll('1', 'No'),
),
],
),
);
}).toList(),
),
);
},
);
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
