Skip to content

Commit

Permalink
Merge branch 'FlutterFlow'
Browse files Browse the repository at this point in the history
* FlutterFlow:
  Error in flow fixed
  Updated for new version (API key at the dependancy addition stage)
  • Loading branch information
Lutik-sun committed Oct 25, 2024
2 parents edaa8a6 + 2ea6373 commit 34825d7
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 87 deletions.
Binary file added SNAGs/activate.snagx
Binary file not shown.
Binary file added SNAGs/adaptyapikey.snagx
Binary file not shown.
Binary file modified versioned_docs/version-3.0/FF_img/activate.webp
Binary file not shown.
Binary file not shown.
Binary file modified versioned_docs/version-3.0/FF_img/check-subscription-end.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
133 changes: 103 additions & 30 deletions versioned_docs/version-3.0/ff-check-subscription-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,127 @@ You can do this by looking at the user profile, which contains all available acc
Now, let’s allow users to purchase your product:

1. Double-click the button that should show the paid content.

2. Open the **Actions** section in the right pane if it’s not already open.

3. Open the **Action Flow Editor**.

4. In the **Select Action Trigger** window, choose **On Tap**.

5. In the **No Actions Created** window, click the **Add Conditional Action** button.

6. In the **Actions Flow Editor** window, choose **Combine Conditions**.
<Zoom>
<img src={require('./FF_img/combined-condition.webp').default}
style={{
<Zoom>
<img src={require('./FF_img/combined-condition.webp').default}
style={{
border: '1px solid #727272', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
}}
/>
</Zoom>

7. In the **Set Actions Arguments** section, choose `currentProfile` variable. This is the Adapty variable that holds data about the current user's profile.

<Zoom>
<img src={require('./FF_img/current-profile.webp').default}
style={{
border: '1px solid #727272', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
}}
/>
</Zoom>

9. Fill in the fields as follows:

| Parameter | Value |
|--------------------------|----------|
| Available Options| Data Structure Field |
| Select Field | accessLevels |
| Available Options | Filter List Items |
| Filter Conditions | Conditions -> Single Condition |

<Zoom>
<img src={require('./FF_img/filter-list-items.webp').default}
style={{
border: '1px solid #727272', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
}}
/>
</Zoom>

7. In the **Set Actions Arguments** section, choose `currentProfile` variable. This is the Adapty variable that holds data about the current user's profile
8. Fill in the fields as follows:

| Parameter | Value |
|--------------------------|----------|
| Available Options| Data Structure Field |
| Select Field | accessLevels |
| Available Options | List Contains Items |

9. In the **Filter Conditions** field, click **UNSET**.

10. In the **Set Variable** window, click **Conditions** -> **Single Condition**.

<Zoom>
<img src={require('./FF_img/single-condition.webp').default}
style={{
border: '1px solid #727272', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
}}
/>
</Zoom>

11. In the new **Set Variable** window, click **UNSET** next to **First value**.

<Zoom>
<img src={require('./FF_img/first-value.webp').default}
style={{
border: '1px solid #727272', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
}}
/>
</Zoom>

9. Click **UNSET**.
10. In the new **Set Variable** window, fill in the fields as follows:
| Parameter | Value |
| ----------------- | --------------------- |
| First Value | Item in List |
| Available Options | Data Structure Field |
| Select Field | accessLevelIdentifier |

| Parameter | Value |
|--------------------------|----------|
| Available Options| Data Structure Field |
| Select Field | accessLevels |
| Available Options | Is Set and Not Empty |

11. Click the **Confirm** button.
12. Click **UNSET** for the second condition.
13. In the new **Set Variable** window, fill in the fields as follows:
9. Click **Confirm**.

| Parameter | Value |
|--------------------------|----------|
| Available Options| Data Structure Field |
| Select Field | accessLevels |
| List Index Options | First |
| Available Options| Data Structure Field |
| Select Field | accessLevels |
| Available Options| Data Structure Field |
| Select Field | isActive |
10. In the **Set Variable** window, click **UNSET** next to **Second value**.

11. In the **Value** field, enter the ID of your access level, in our example we use `premium`.

<Zoom>
<img src={require('./FF_img/second-value.webp').default}
style={{
border: '1px solid #727272', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
}}
/>
</Zoom>

12. Click **Confirm**.



13. In the new **Set Variable** window where you returned, fill in the fields as follows:

| Parameter | Value |
|--------------------------|----------|
| Available Options| Item as Index |
| List Index Options | First |
| Available Options| Data Structure Field |
| Select Field | accessLevels |
| Available Options| Data Structure Field |
| Select Field | isActive |

<Zoom>
<img src={require('./FF_img/check-subscription-end.webp').default}
Expand All @@ -74,6 +146,7 @@ Now, let’s allow users to purchase your product:
}}
/>
</Zoom>

14. Click the **Confirm** button twice.

Now, add the actions for what happens next — if the user has the right subscription or not. Either take them to the next page or show the paywall so they can buy access.
66 changes: 9 additions & 57 deletions versioned_docs/version-3.0/ff-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,71 +76,23 @@ To get started, just [add the Adapty Plugin](ff-getting-started#add-the-adapty-p
}}
/>
</Zoom>
5. Click the **Add** button.

The Adapty FF Plugin will now be added as a dependency to your project. In the **Adapty FF Plugin** window, you’ll find all the Adapty resources that have been imported into your project.



## Add plugin activation action

To get the Adapty plugin up and running, you'll need to activate it.

1. In your FlutterFlow project, open **Custom Code** from the left menu.

<Zoom>
<img src={require('./FF_img/custom_code.webp').default}
style={{
border: '1px solid #727272', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
}}
/>
</Zoom>

2. Click the **Add** button.

<!--- <Zoom>
<img src={require('./FF_img/activate.webp').default}
style={{
border: '1px solid #727272', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
}}
/>
</Zoom> --->

3. Choose **Action**.
5. Click the **Add** button.

4. Enter the name of the new action as `activateAdaptyAction`.
6. For `YOUR_API_KEY` in the **Adapty** window, copy the **Public SDK key** from the [**App Settings** -> **General** tab](https://app.adapty.io/settings/general) in the Adapty Dashboard.

<Zoom>
<img src={require('./FF_img/add-activateAdaptyAction.webp').default}
<img src={require('./FF_img/adaptyapikey.webp').default}
style={{
border: 'none', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
border: '1px solid #727272', /* border width and color */
width: '700px', /* image width */
display: 'block', /* for alignment */
margin: '0 auto' /* center alignment */
}}
/>
</Zoom>

5. Paste to the bottom of the created file the next code snipped:

```swift
import 'package:adapty_xtuel0/custom_code/actions/index.dart'
as adapty_xtuel0_actions;

Future activateAdaptyAction() async {
await adapty_xtuel0_actions.activate("YOUR_API_KEY");
}
```

6. For `YOUR_API_KEY`, copy the **Public SDK key** from the [**App Settings** -> **General** tab](https://app.adapty.io/settings/general) in the Adapty Dashboard. Each app has its own SDK key, so if you have multiple apps, make sure you grab the right one.

7. Click **Save Action**.
The Adapty FF Plugin will now be added as a dependency to your project. In the **Adapty FF Plugin** window, you’ll find all the Adapty resources that have been imported into your project.

## Call the new activation action at application launch

Expand All @@ -157,7 +109,7 @@ Future activateAdaptyAction() async {
/>
</Zoom>

2. Click the plus (**+**) button and choose `activateAdaptyAction`.
2. Click the plus (**+**) button and choose `activate`.

<Zoom>
<img src={require('./FF_img/activate.webp').default}
Expand Down

0 comments on commit 34825d7

Please sign in to comment.