managarten/apps-archived/memoro/apps/mobile/features/rating/services/ratingService.ts
Till-JS 61d181fbc2 chore: archive inactive projects to apps-archived/
Move inactive projects out of active workspace:
- bauntown (community website)
- maerchenzauber (AI story generation)
- memoro (voice memo app)
- news (news aggregation)
- nutriphi (nutrition tracking)
- reader (reading app)
- uload (URL shortener)
- wisekeep (AI wisdom extraction)

Update CLAUDE.md documentation:
- Add presi to active projects
- Document archived projects section
- Update workspace configuration

Archived apps can be re-activated by moving back to apps/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 07:03:59 +01:00

60 lines
1.5 KiB
TypeScript

import * as StoreReview from 'expo-store-review';
import { Platform } from 'react-native';
class RatingService {
/**
* Check if the platform supports in-app reviews
*/
async isAvailable(): Promise<boolean> {
try {
return await StoreReview.isAvailableAsync();
} catch (error) {
console.error('Error checking store review availability:', error);
return false;
}
}
/**
* Request a review from the user
* This will show the native review dialog if available
*/
async requestReview(): Promise<boolean> {
try {
const isAvailable = await this.isAvailable();
if (!isAvailable) {
console.log('Store review is not available on this device');
return false;
}
// Request the review
await StoreReview.requestReview();
// We can't know if the user actually submitted a review,
// but we can track that we showed the prompt
return true;
} catch (error) {
console.error('Error requesting store review:', error);
return false;
}
}
/**
* Get the store URL for manual reviews (fallback)
* This can be used when in-app review is not available
*/
getStoreUrl(): string | null {
if (Platform.OS === 'ios') {
// Memoro App Store ID
const appStoreId = '6451258411';
return `https://apps.apple.com/app/id${appStoreId}?action=write-review`;
} else if (Platform.OS === 'android') {
// Memoro Android package name
const packageName = 'com.memo.beta';
return `https://play.google.com/store/apps/details?id=${packageName}`;
}
return null;
}
}
export const ratingService = new RatingService();