Overview
This guide covers integrating Mazeed+ placement API into React Native mobile applications using WebView for rendering ad placements. Integration Method: Direct API call from mobile applicationMazeed+ Credentials
You will receive:- Publishable API Key – For
x-publishable-api-keyheader - Placement ID – For
identifierfield
API Endpoint
Response Formats
JSON Response (Default)
When requesting withAccept: application/json (default):
| Attribute | Type | Description |
|---|---|---|
identifier | String | The placement ID requested |
templateName | String | Template name |
template_data | Object | Structured data for native rendering |
HTML Response
When requesting withAccept: text/html, the API returns an HTML document directly in the response body.
Request Attributes
Required Attributes
| Attribute | Description | Required |
|---|---|---|
identifier | Placement ID provided by Mazeed+ | Yes |
attributes.userId | Unique identifier for the user | Yes |
attributes.mobile | Mobile number in international format (e.g., +9665xxxxxxx) | Yes |
Recommended Optional Attributes
| Attribute | Description | Example |
|---|---|---|
attributes.country | Country code | "sa" |
attributes.currency | Currency code | "sar" |
attributes.firstname | User’s first name | "Ahmed" |
attributes.lastname | User’s last name | "Al-Rashid" |
attributes.gender | User’s gender | "male" or "female" |
attributes.age | User’s age in years | 28 |
attributes.interests | Array of user interest strings | ["sports", "tech"] |
attributes.confirmationref | Order or transaction reference | "ORD-12345" |
attributes.paymenttype | Payment method used | "credit_card", "cash" |
attributes.cartItems | JSON string of cart items | "[{\"id\":\"123\"}]" |
attributes.q | Search query for finding relevant products | "كولومبي قهوه" |
React Native Implementation
Configuration
API Service
WebView Renderer
Install Dependencies
WebView Component
Usage Example
Integration Summary
Quick Checklist:- Get Publishable API Key and Placement ID from Mazeed+
- Install
react-native-webview - Configure credentials
- Implement API service
- Create WebView component
- Integrate into screen
- Call API with:
identifier,userId,mobile - Receive:
htmlandcss - Render in WebView
Performance: Preloading WebView
Recommendation: Preload WebView before showing to users.Best Practices
- Hide WebView until content is fully rendered
- Use
onLoadEndcallback - Don’t show empty WebView while loading
